diff --git a/CMakeLists.txt b/CMakeLists.txt index de79677..ff3c464 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,7 +114,10 @@ elseif(${IS_CLANG}) if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${MINIMAL_CLANG} AND NOT ${IGNORE_MINIMAL_COMPILER_VERSION}) message(FATAL_ERROR "Clang ${MINIMAL_CLANG} or higher is required.") endif() - if (${CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE} OR (MINGW AND NOT USER_DEFINED_INTERPROCEDURAL_OPTIMIZATION_RELEASE)) # CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE is false on llvm-mingw toolchains even though it is supported + if (MINGW AND NOT USER_DEFINED_INTERPROCEDURAL_OPTIMIZATION_RELEASE) # CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE is false on llvm-mingw toolchains even though it is supported + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE YES) + endif() + if (CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto=thin") if (NOT DEFINED EMSCRIPTEN) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fwhole-program-vtables")