From 6d7b6ae9cafff4cbea19b9588c6cb216ee3a42fd Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sun, 22 Dec 2013 15:17:36 +0000 Subject: fixes for mac os x --- CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 0df702b29..859575a69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,6 +44,10 @@ endif() if(WIN32) add_flags("/MP") +elseif(APPLE) + if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + add_flags("-pthread") + endif() else() add_flags("-pthread") endif() @@ -114,10 +118,10 @@ endif() set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE_BAK}") if (NOT WIN32) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic") - set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -rdynamic") - set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -rdynamic") - set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_PROFILE} -rdynamic") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -rdynamic") + set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -rdynamic") + set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -rdynamic") + set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_PROFILE} -rdynamic") endif() add_subdirectory (src) -- cgit v1.2.3 From a71299c46b7b53a5f9f11ea2851f8e5b66d2d912 Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sun, 22 Dec 2013 15:41:01 +0000 Subject: fixed rdynamic as its not acctually needed a cmake handles it, looks like the problem was caused by the linux linker accepting the option twice and the os x linker not --- CMakeLists.txt | 7 ------- 1 file changed, 7 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 859575a69..f8c740ae3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,12 +117,5 @@ else() endif() set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE_BAK}") -if (NOT WIN32) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -rdynamic") - set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -rdynamic") - set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -rdynamic") - set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_PROFILE} -rdynamic") -endif() - add_subdirectory (src) -- cgit v1.2.3 From 7076f8e73a1e4fed8388d0604756c4c91cafb416 Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Thu, 2 Jan 2014 17:11:40 +0000 Subject: fixed compiler warnings not being enabled in clang --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 67f70142b..451854074 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,11 +112,15 @@ add_subdirectory(lib/expat/) add_subdirectory(lib/luaexpat/) add_subdirectory(lib/md5/) -# Re-add the maximum warning level: +# Remove disabling the maximum warning level: +# clang does not like a command line that reads -Wall -Wextra -w -Wall -Wextra and does not output any warnings # We do not do that for MSVC since MSVC produces an awful lot of warnings for its own STL headers; # the important warnings will be turned on using #pragma in Globals.h if (NOT MSVC) - add_flags("-Wall -Wextra") + string(REPLACE "-w" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + string(REPLACE "-w" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") + string(REPLACE "-w" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + string(REPLACE "-w" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") endif() add_subdirectory (src) -- cgit v1.2.3 From 623146996a6a75cd7218bc6a0756511aabfd5098 Mon Sep 17 00:00:00 2001 From: Tycho Date: Tue, 7 Jan 2014 05:08:58 -0800 Subject: Fixed FreeBSD compilition --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'CMakeLists.txt') 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) -- cgit v1.2.3