Skip to content

Commit

Permalink
Add more LTO flags.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 5061af1cc5078f0626c0f74cf5b672506d371a80
  • Loading branch information
levlam committed Mar 17, 2018
1 parent 242c39d commit f270a2e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit f270a2e

Please sign in to comment.