|
|
|
@ -44,11 +44,11 @@ else()
|
|
|
|
|
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no OpenMP support. Please use a different C++ compiler.") |
|
|
|
|
endif() |
|
|
|
|
# Link time optimization check |
|
|
|
|
set(CMAKE_REQUIRED_FLAGS -flto) |
|
|
|
|
CHECK_CXX_COMPILER_FLAG(-flto COMPILER_SUPPORTS_FLTO) |
|
|
|
|
set(CMAKE_REQUIRED_FLAGS -flto=auto) |
|
|
|
|
CHECK_CXX_COMPILER_FLAG(-flto=auto COMPILER_SUPPORTS_FLTO) |
|
|
|
|
if(COMPILER_SUPPORTS_FLTO AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug") |
|
|
|
|
set(default_options ${default_options} -flto) |
|
|
|
|
set(linker_options ${linker_options} -flto) |
|
|
|
|
set(default_options ${default_options} -flto=auto) |
|
|
|
|
set(linker_options ${linker_options} -flto=auto) |
|
|
|
|
endif() |
|
|
|
|
unset(CMAKE_REQUIRED_FLAGS) |
|
|
|
|
# Clang can use lto only with gold linker |
|
|
|
|