From 98d7a993e57ec8aa3c5cfbda57a8f991201b2645 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sat, 4 Jul 2015 17:39:52 +0100 Subject: Clean up flags passed to the compiler. - Clang builds on OS X should use libc++ instead of libstdc++. - GCC no longer needs no-long-long as we have C++11 support now. - GCC does not need -fno-leading-underscore. --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f9297f88..8075b05d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,8 +89,9 @@ else() # If on a *nix system, also set the compile flags to remove GNU extensions (favor ISO C++) as well as reject non-ISO C++ code, also remove all leading underscores in exported symbols (only on GNU compiler) if(UNIX) set(CXXFLAGS "${CXXFLAGS} -ansi -pedantic ${CMAKE_CXX_FLAGS}") - if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(CXXFLAGS "${CXXFLAGS} -Wno-long-long -fno-leading-underscore") + if(${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") + set(CXXFLAGS "${CXXFLAGS} -stdlib=libc++") + set(LDFLAGS "${LDFLAGS} -stdlib=libc++") endif() endif() endif() -- cgit