Add interprocedural optimization flags only when they are supported if clang is in use
This commit is contained in:
parent
c2f70924ef
commit
d687544519
|
@ -77,7 +77,10 @@ elseif(${IS_CLANG})
|
|||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${MINIMAL_CLANG})
|
||||
message(FATAL_ERROR "Clang ${MINIMAL_CLANG} or higher is required.")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto=full -fwhole-program-vtables -fstrict-vtable-pointers")
|
||||
if (${CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE} OR MINGW) # CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE is false on llvm-mingw toolchains even though it is supported
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto=full -fwhole-program-vtables")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fstrict-vtable-pointers")
|
||||
endif()
|
||||
string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_BUILD_TYPE)
|
||||
if (UPPERCASE_BUILD_TYPE STREQUAL RELEASE)
|
||||
|
|
Loading…
Reference in New Issue