From 4bbeab4236bfa2f04620b4f4ef1d9f9f079f51c8 Mon Sep 17 00:00:00 2001 From: David Chavez Date: Sun, 7 Aug 2022 13:26:22 +0200 Subject: [PATCH] Use -O2 for Release config builds --- CMakeLists.txt | 15 ++++++++++----- soh/CMakeLists.txt | 1 - 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb31fc818fc..7533ce89751 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,11 +42,16 @@ endif() ################################################################################ # Global configuration types ################################################################################ -set(CMAKE_CONFIGURATION_TYPES - "Debug" - "Release" - CACHE STRING "" FORCE -) +if (CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch") +set(CMAKE_C_FLAGS_DEBUG "-O3 -ffast-math") +set(CMAKE_CXX_FLAGS_DEBUG "-O3 -ffast-math") +set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG -ffast-math") +set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG-ffast-math ") +else() +set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG") +set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") +set(CMAKE_OBJCXX_FLAGS_RELEASE "-O2 -DNDEBUG") +endif() if(NOT CMAKE_BUILD_TYPE ) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE) diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index 54700d65d80..c64c0308a7c 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -1805,7 +1805,6 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang") $<$:-fpermissive> $<$:-Wno-deprecated-enum-enum-conversion> -pthread - -O3 -ffast-math ) target_link_options(${PROJECT_NAME} PRIVATE