Add cmake option ENABLE_LTO for link time optimization on Release builds.

pull/715/head
phkahler 2020-09-21 15:16:26 -04:00
parent 39f419e28c
commit d575da8611
1 changed files with 4 additions and 0 deletions

View File

@ -98,6 +98,10 @@ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "X8
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLOAT_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLOAT_FLAGS}")
endif() endif()
if(ENABLE_LTO)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
if(ENABLE_OPENMP) if(ENABLE_OPENMP)
include(FindOpenMP) include(FindOpenMP)
if(OpenMP_FOUND) if(OpenMP_FOUND)