Skip to content

Commit

Permalink
use -flto instead of flto=auto for compilers other than GCC >= 12, as…
Browse files Browse the repository at this point in the history
… per suggestion of Axel
  • Loading branch information
patrickbr committed Oct 11, 2024
1 parent 2209fc0 commit 17c6f00
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ add_compile_options(-Wall -Wextra -Wno-missing-field-initializers)
add_compile_options(-DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=0)

# Basic optimization
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
add_compile_options(-flto=auto)
else()
add_compile_options(-flto)
add_link_options(-flto)
endif()

add_compile_options(-march=native)
Expand Down

0 comments on commit 17c6f00

Please sign in to comment.