Browse Source

Fixed LTO warnings

interpolate
Michael Uleysky 2 years ago
parent
commit
8fa655cd09
  1. 8
      CMakeLists.txt

8
CMakeLists.txt

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

Loading…
Cancel
Save