Use -O2 for Release config builds (#1083)

This commit is contained in:
David Chavez 2022-08-08 12:01:45 +02:00 committed by GitHub
parent 7f233de502
commit 9afbe42720
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -45,11 +45,16 @@ endif()
################################################################################ ################################################################################
# Global configuration types # Global configuration types
################################################################################ ################################################################################
set(CMAKE_CONFIGURATION_TYPES if (CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch")
"Debug" set(CMAKE_C_FLAGS_DEBUG "-O3 -ffast-math")
"Release" set(CMAKE_CXX_FLAGS_DEBUG "-O3 -ffast-math")
CACHE STRING "" FORCE set(CMAKE_C_FLAGS_RELEASE "-O3 -ffast-math -DNDEBUG")
) set(CMAKE_CXX_FLAGS_RELEASE "-O3 -ffast-math -DNDEBUG")
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 ) if(NOT CMAKE_BUILD_TYPE )
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE)

View File

@ -1805,7 +1805,6 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
$<$<COMPILE_LANGUAGE:CXX>:-fpermissive> $<$<COMPILE_LANGUAGE:CXX>:-fpermissive>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-enum-enum-conversion> $<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-enum-enum-conversion>
-pthread -pthread
-O3 -ffast-math
) )
target_link_options(${PROJECT_NAME} PRIVATE target_link_options(${PROJECT_NAME} PRIVATE