From 2cfb2428d28e84284dc5316f7c4095199bd51d37 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Fri, 11 May 2018 04:12:58 +0000 Subject: [PATCH] build/cmake: pass -DNDEBUG by default like msvc Downstream may override CMAKE_CXX_FLAGS_RELEASE in order to enforce consistent optimization flags for every package. If -DNDEBUG is lost RPCS3 may run slower and fall victim to assertions in bundled libs. --- rpcs3/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index ca4eee1096..8302a01ac7 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -81,6 +81,10 @@ add_custom_command(OUTPUT something_that_never_exists # Check for a sufficient compiler and set build options include(ConfigureCompiler) +if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + add_definitions(-DNDEBUG) +endif() + if(WIN32) add_definitions(-DUNICODE) add_definitions(-D_WIN32_WINNT=0x0601)