Skip to content

Commit

Permalink
only add -flto=auto for GCC > 12
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbr committed Oct 10, 2024
1 parent ab68d62 commit 43ce8bf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ endif()

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
add_compile_options(-march=native -flto=auto)
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
add_compile_options(-flto=auto)
endif()

add_compile_options(-march=native)
# Enable fast-math
add_compile_options(-ffast-math)

Expand Down

0 comments on commit 43ce8bf

Please sign in to comment.