mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
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
This commit is contained in:
parent
2ddb6f1440
commit
db917fe8aa
@ -42,6 +42,7 @@ check_include_file(windows.h HAVE_WINDOWS_H)
|
|||||||
# library checks
|
# library checks
|
||||||
include(CheckLibraryExists)
|
include(CheckLibraryExists)
|
||||||
check_library_exists(pthread pthread_create "" HAVE_LIBPTHREAD)
|
check_library_exists(pthread pthread_create "" HAVE_LIBPTHREAD)
|
||||||
|
check_library_exists(dl dlopen "" HAVE_LIBDL)
|
||||||
|
|
||||||
# function checks
|
# function checks
|
||||||
include(CheckSymbolExists)
|
include(CheckSymbolExists)
|
||||||
|
@ -33,7 +33,9 @@ macro(add_llvm_executable name)
|
|||||||
if( MINGW )
|
if( MINGW )
|
||||||
target_link_libraries(${name} imagehlp psapi)
|
target_link_libraries(${name} imagehlp psapi)
|
||||||
elseif( CMAKE_HOST_UNIX )
|
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 )
|
if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD )
|
||||||
target_link_libraries(${name} pthread)
|
target_link_libraries(${name} pthread)
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user