diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-01-07 14:08:58 +0100 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-01-07 14:08:58 +0100 |
commit | 623146996a6a75cd7218bc6a0756511aabfd5098 (patch) | |
tree | 408137ddb7f285a20c6f633dc77b804b1007cd75 | |
parent | Merge branch 'master' of github.com:mc-server/MCServer (diff) | |
download | cuberite-623146996a6a75cd7218bc6a0756511aabfd5098.tar cuberite-623146996a6a75cd7218bc6a0756511aabfd5098.tar.gz cuberite-623146996a6a75cd7218bc6a0756511aabfd5098.tar.bz2 cuberite-623146996a6a75cd7218bc6a0756511aabfd5098.tar.lz cuberite-623146996a6a75cd7218bc6a0756511aabfd5098.tar.xz cuberite-623146996a6a75cd7218bc6a0756511aabfd5098.tar.zst cuberite-623146996a6a75cd7218bc6a0756511aabfd5098.zip |
-rw-r--r-- | CMakeLists.txt | 11 | ||||
-rw-r--r-- | lib/lua/CMakeLists.txt | 2 | ||||
-rw-r--r-- | lib/sqlite/CMakeLists.txt | 2 |
3 files changed, 13 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 451854074..135826abc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,17 @@ if (WIN32) add_definitions(-DLUA_BUILD_AS_DLL) endif() +#On Unix we use two dynamic loading libraries dl and ltdl. +#Preference is for dl on unknown systems as it is specified in POSIX +#the dynamic loader is used by lua and sqllite. +if (UNIX) + if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") + set(DYNAMIC_LOADER ltdl) + else() + set(DYNAMIC_LOADER dl) + endif() +endif() + # The Expat library is linked in statically, make the source files aware of that: add_definitions(-DXML_STATIC) diff --git a/lib/lua/CMakeLists.txt b/lib/lua/CMakeLists.txt index 63ac18e90..b4b5b5f1d 100644 --- a/lib/lua/CMakeLists.txt +++ b/lib/lua/CMakeLists.txt @@ -26,5 +26,5 @@ else() endif() if (UNIX) - target_link_libraries(lua m dl) + target_link_libraries(lua m ${DYNAMIC_LOADER}) endif() diff --git a/lib/sqlite/CMakeLists.txt b/lib/sqlite/CMakeLists.txt index 07e5a22cb..0815127ef 100644 --- a/lib/sqlite/CMakeLists.txt +++ b/lib/sqlite/CMakeLists.txt @@ -21,5 +21,5 @@ endif() add_library(sqlite ${SOURCE}) if (UNIX) - target_link_libraries(sqlite dl) + target_link_libraries(sqlite ${DYNAMIC_LOADER}) endif() |