CMakeLists.txt: Set CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE to YES when using a llvm-mingw toolchain
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
23f24e55b1
commit
8091d92933
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue