CMake: Set optimisation flags if no build type specified

This commit is contained in:
Jonathan G Rennison
2020-06-27 19:28:54 +01:00
parent 4cee6f3d79
commit ecc9eb4df1

View File

@@ -68,6 +68,11 @@ macro(compile_flags)
-fno-strict-aliasing -fno-strict-aliasing
) )
if(NOT CMAKE_BUILD_TYPE)
# Sensible default if no build type specified
add_compile_options(-O2 -DNDEBUG)
endif(NOT CMAKE_BUILD_TYPE)
#add_compile_options( #add_compile_options(
# When we are a stable release (Release build + USE_ASSERTS not set), # When we are a stable release (Release build + USE_ASSERTS not set),
# assertations are off, which trigger a lot of warnings. We disable # assertations are off, which trigger a lot of warnings. We disable