From 9562103f7e073cd357148d0d46a3bbd3d8726360 Mon Sep 17 00:00:00 2001 From: Twan van Laarhoven Date: Mon, 11 May 2020 00:54:26 +0200 Subject: [PATCH] Use whole program optimization --- CMakeLists.txt | 3 +++ CMakeSettings.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cc057bb7..1fd3c9fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,9 @@ if (${VCPKG_TARGET_TRIPLET} MATCHES ".*-static") foreach(CompilerFlag ${CompilerFlags}) string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}") endforeach() + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /GL") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LTCG") # Need explicit dependencies on wx's dependencies find_package(png REQUIRED) find_package(tiff REQUIRED) diff --git a/CMakeSettings.json b/CMakeSettings.json index 94002c59..3cd2c91b 100644 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -51,7 +51,7 @@ { "name": "x86-Release-static", "generator": "Ninja", - "configurationType": "RelWithDebInfo", + "configurationType": "Release", "buildRoot": "${projectDir}\\out\\build\\${name}", "installRoot": "${projectDir}\\out\\install\\${name}", "cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x86-windows-static",