[llvm-commits] [llvm] r72311 - in /llvm/trunk/cmake: config-ix.cmake modules/AddLLVM.cmake

Oscar Fuentes ofv at wanadoo.es
Fri May 22 19:37:24 PDT 2009


Author: ofv
Date: Fri May 22 21:37:24 2009
New Revision: 72311

URL: http://llvm.org/viewvc/llvm-project?rev=72311&view=rev
Log:
CMake: Use libdl only when available. Fixes build on FreeBSD.

Modified:
    llvm/trunk/cmake/config-ix.cmake
    llvm/trunk/cmake/modules/AddLLVM.cmake

Modified: llvm/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/config-ix.cmake?rev=72311&r1=72310&r2=72311&view=diff

==============================================================================
--- llvm/trunk/cmake/config-ix.cmake (original)
+++ llvm/trunk/cmake/config-ix.cmake Fri May 22 21:37:24 2009
@@ -42,6 +42,7 @@
 # library checks
 include(CheckLibraryExists)
 check_library_exists(pthread pthread_create "" HAVE_LIBPTHREAD)
+check_library_exists(dl dlopen "" HAVE_LIBDL)
 
 # function checks
 include(CheckSymbolExists)

Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=72311&r1=72310&r2=72311&view=diff

==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Fri May 22 21:37:24 2009
@@ -33,7 +33,9 @@
     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()





More information about the llvm-commits mailing list