diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index d8e23c85..cd54e320 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -36,6 +36,10 @@ if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" ) endif() +if ( CMAKE_GENERATOR STREQUAL Xcode ) + set( CMAKE_GENERATOR_IS_XCODE true ) +endif() + # Force release build by default, speed is of the essence if ( NOT CMAKE_BUILD_TYPE ) set( CMAKE_BUILD_TYPE Release ) diff --git a/cpp/ycm/CMakeLists.txt b/cpp/ycm/CMakeLists.txt index 153702f7..cf54856e 100644 --- a/cpp/ycm/CMakeLists.txt +++ b/cpp/ycm/CMakeLists.txt @@ -120,7 +120,7 @@ endif() ############################################################################# # We want warnings if we accidentally use C++11 features -if ( COMPILER_IS_CLANG ) +if ( COMPILER_IS_CLANG AND NOT CMAKE_GENERATOR_IS_XCODE ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wc++98-compat" ) endif()