From ce505f6814fbed638bd638c46165cd8a09fb9872 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 25 Apr 2014 07:58:59 -0700 Subject: Use libc++ on OSX Fixes issues with https://github.com/mc-server/MCServer/commit/f3dfc0349d7008efa50855c739d86918bdbf4a88 in XCode. Tested on Mac (Makefile and XCode) and Linux. --- SetFlags.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SetFlags.cmake b/SetFlags.cmake index c5a3a0697..da69293f7 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -188,6 +188,9 @@ macro(set_exe_flags) add_flags_cxx("-ffast-math") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + if (APPLE) + add_flags_cxx("-stdlib=libc++") + endif() # clang does not provide the __extern_always_inline macro and a part of libm depends on this when using fast-math add_flags_cxx("-D__extern_always_inline=inline") add_flags_cxx("-Werror -Weverything -Wno-c++98-compat-pedantic -Wno-string-conversion") -- cgit v1.2.3 From 0f9e399351ed4d83d397ef71ea575c1fdf77e981 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 25 Apr 2014 10:32:39 -0700 Subject: Move to line 47. --- SetFlags.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/SetFlags.cmake b/SetFlags.cmake index da69293f7..7b2b6379e 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -45,6 +45,7 @@ macro(set_flags) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11") + add_flags_cxx("-stdlib=libc++") else() add_flags_cxx("-pthread") endif() @@ -188,9 +189,6 @@ macro(set_exe_flags) add_flags_cxx("-ffast-math") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - if (APPLE) - add_flags_cxx("-stdlib=libc++") - endif() # clang does not provide the __extern_always_inline macro and a part of libm depends on this when using fast-math add_flags_cxx("-D__extern_always_inline=inline") add_flags_cxx("-Werror -Weverything -Wno-c++98-compat-pedantic -Wno-string-conversion") -- cgit v1.2.3 From d094beb45ab3ed6ba6ac086093926747df1f98a8 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 25 Apr 2014 16:40:57 -0700 Subject: Needs the -stdlib linker flag too. --- SetFlags.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/SetFlags.cmake b/SetFlags.cmake index 7b2b6379e..4eed529bd 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -46,6 +46,7 @@ macro(set_flags) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11") add_flags_cxx("-stdlib=libc++") + add_flags_lnk("-stdlib=libc++") else() add_flags_cxx("-pthread") endif() -- cgit v1.2.3