From 09e9fff7b5fedcbb60382d81491586914a76112f Mon Sep 17 00:00:00 2001 From: gir489 <100792176+gir489returns@users.noreply.github.com> Date: Thu, 11 Jan 2024 05:52:31 -0500 Subject: [PATCH] Added x64-Release-FastCompile build. (#2651) --- CMakeLists.txt | 12 +++++++----- CMakeSettings.json | 14 +++++++++++++- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a4d0446..5e5f319e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,10 +68,12 @@ add_compile_definitions(YimMenu # Optimizations if(MSVC) - set(CMAKE_MODULE_LINKER_FLAGS - "${CMAKE_MODULE_LINKER_FLAGS} /LTCG /OPT:REF,ICF /GUARD:NO") + if(OPTIMIZE) + set(CMAKE_MODULE_LINKER_FLAGS + "${CMAKE_MODULE_LINKER_FLAGS} /LTCG /OPT:REF,ICF /GUARD:NO") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO - "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /O2 /Ox /Oi /Ot /Oy /Ob3 /sdl- /GL /GF /GS- /Gw") - string(REPLACE "/Ob1" "/Ob3" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO + "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /O2 /Oi /Ot /Oy /Ob3 /sdl- /GL /GF /GS- /Gw") + string(REPLACE "/Ob1" "/Ob3" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) + endif() endif() diff --git a/CMakeSettings.json b/CMakeSettings.json index 193e9988..aac7d102 100644 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -1,5 +1,16 @@ { "configurations": [ + { + "name": "x64-Release-FastCompile", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "inheritEnvironments": [ "msvc_x64_x64" ], + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "" + }, { "name": "x64-Release", "generator": "Ninja", @@ -9,7 +20,8 @@ "installRoot": "${projectDir}\\out\\install\\${name}", "cmakeCommandArgs": "", "buildCommandArgs": "", - "ctestCommandArgs": "" + "ctestCommandArgs": "", + "variables": [ {"name": "OPTIMIZE", "value": "YES", "type": "BOOL"} ] }, { "name": "x64-Debug",