aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2009-05-23 02:37:24 +0000
committerOscar Fuentes <ofv@wanadoo.es>2009-05-23 02:37:24 +0000
commit9574c3047b618eb888b3718e3d596ded4dfdcc68 (patch)
tree4ff5cb5d01835f8a31214d94e16d974d730fa65f /cmake
parent1411813d8b8133817d62128db34bf61fdd4bb17d (diff)
downloadexternal_llvm-9574c3047b618eb888b3718e3d596ded4dfdcc68.zip
external_llvm-9574c3047b618eb888b3718e3d596ded4dfdcc68.tar.gz
external_llvm-9574c3047b618eb888b3718e3d596ded4dfdcc68.tar.bz2
CMake: Use libdl only when available. Fixes build on FreeBSD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72311 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rwxr-xr-xcmake/config-ix.cmake1
-rwxr-xr-xcmake/modules/AddLLVM.cmake4
2 files changed, 4 insertions, 1 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index adebb1b..0c903a1 100755
--- a/cmake/config-ix.cmake
+++ b/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/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index 62d9f31..1f0ff74 100755
--- a/cmake/modules/AddLLVM.cmake
+++ b/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()