diff options
author | Oscar Fuentes <ofv@wanadoo.es> | 2009-05-23 02:37:24 +0000 |
---|---|---|
committer | Oscar Fuentes <ofv@wanadoo.es> | 2009-05-23 02:37:24 +0000 |
commit | eeac588471e34a23114d002cf8b9ad3bf1c7f846 (patch) | |
tree | a8023de63a65edeeac5e670abe10e5c81e2ef737 | |
parent | f98fc352b82fa19149eb57302dd3bcc4e1532a48 (diff) | |
download | bcm5719-llvm-eeac588471e34a23114d002cf8b9ad3bf1c7f846.tar.gz bcm5719-llvm-eeac588471e34a23114d002cf8b9ad3bf1c7f846.zip |
CMake: Use libdl only when available. Fixes build on FreeBSD.
llvm-svn: 72311
-rwxr-xr-x | llvm/cmake/config-ix.cmake | 1 | ||||
-rwxr-xr-x | llvm/cmake/modules/AddLLVM.cmake | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index adebb1b38f5..0c903a19029 100755 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -42,6 +42,7 @@ check_include_file(windows.h HAVE_WINDOWS_H) # library checks include(CheckLibraryExists) check_library_exists(pthread pthread_create "" HAVE_LIBPTHREAD) +check_library_exists(dl dlopen "" HAVE_LIBDL) # function checks include(CheckSymbolExists) diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index 62d9f3195bb..1f0ff74c12c 100755 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -33,7 +33,9 @@ macro(add_llvm_executable name) if( MINGW ) target_link_libraries(${name} imagehlp psapi) elseif( CMAKE_HOST_UNIX ) - target_link_libraries(${name} dl) + if( HAVE_LIBDL ) + target_link_libraries(${name} dl) + endif() if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD ) target_link_libraries(${name} pthread) endif() |