diff --git a/cmake/CompileFlags.cmake b/cmake/CompileFlags.cmake index 9bf15e6b78..691feaed0d 100644 --- a/cmake/CompileFlags.cmake +++ b/cmake/CompileFlags.cmake @@ -96,7 +96,10 @@ macro(compile_flags) if(NOT CMAKE_BUILD_TYPE) # Sensible default if no build type specified - add_compile_options(-O2 -DNDEBUG) + add_compile_options(-O2) + if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + add_compile_options(-DNDEBUG) + endif() endif(NOT CMAKE_BUILD_TYPE) # When we are a stable release (Release build + USE_ASSERTS not set),