Add more LTO flags.
GitOrigin-RevId: 5061af1cc5078f0626c0f74cf5b672506d371a80
This commit is contained in:
parent
242c39dc91
commit
f270a2ef18
@ -45,8 +45,16 @@ if (POLICY CMP0069)
|
||||
if (IPO_SUPPORTED)
|
||||
# set_property(DIRECTORY PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) do not work?
|
||||
string(REPLACE ";" " " CXX_FLAGS_IPO "${CMAKE_CXX_COMPILE_OPTIONS_IPO}")
|
||||
message(STATUS "Use link time optimizations: ${CXX_FLAGS_IPO}")
|
||||
message(STATUS "Use link time CXX optimization options: ${CXX_FLAGS_IPO}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CXX_FLAGS_IPO}")
|
||||
|
||||
string(REPLACE ";" " " C_FLAGS_IPO "${CMAKE_C_COMPILE_OPTIONS_IPO}")
|
||||
message(STATUS "Use link time C optimization options: ${C_FLAGS_IPO}")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${C_FLAGS_IPO}")
|
||||
|
||||
string(REPLACE ";" " " LINK_FLAGS_IPO "${CMAKE_CXX_LINK_OPTIONS_IPO}")
|
||||
message(STATUS "Use link time optimization linker options: ${LINK_FLAGS_IPO}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${LINK_FLAGS_IPO}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
Reference in New Issue
Block a user