Explorar o código

Merge pull request #630 from jcfr/fix-core-linking-on-freebsd

CTKCore: Generalize test checking if dl library is available.
Jean-Christophe Fillion-Robin %!s(int64=9) %!d(string=hai) anos
pai
achega
6437d4c5f4
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      Libs/Core/CMakeLists.txt

+ 4 - 1
Libs/Core/CMakeLists.txt

@@ -142,7 +142,10 @@ ctkMacroBuildLib(
   )
 
 # Needed for ctkBackTrace
-if(UNIX AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
+if(UNIX)
+  # FreeBSD: The same functionality that is in linux's libdl is provided in FreeBSD's libc
+  find_library(HAVE_LIBDL dl)
+  if(HAVE_LIBDL)
   target_link_libraries(${PROJECT_NAME} dl)
 elseif(WIN32 AND NOT MINGW)
   target_link_libraries(${PROJECT_NAME} dbghelp)