From fb67adbd82424974a545efd08be50d2c68005588 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Thu, 3 Nov 2022 19:00:25 +0000 Subject: [PATCH] Fix assert macro on Apple/clang when using default cmake build --- cmake/CompileFlags.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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),