Skip to content

Commit

Permalink
No LTO in debug
Browse files Browse the repository at this point in the history
  • Loading branch information
SChernykh committed Mar 3, 2025
1 parent 31e3e52 commit fde2da8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmake/flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
set(OPTIMIZATION_FLAGS "-O3 -ffast-math -s")
endif()

if (WITH_LTO)
if (WITH_LTO AND (CMAKE_BUILD_TYPE STREQUAL "Release"))
set(OPTIMIZATION_FLAGS "${OPTIMIZATION_FLAGS} -flto=auto -fuse-linker-plugin")
endif()

Expand Down Expand Up @@ -125,7 +125,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
set(OPTIMIZATION_FLAGS "-O3 -ffast-math -funroll-loops -fmerge-all-constants")
endif()

if (WITH_LTO)
if (WITH_LTO AND (CMAKE_BUILD_TYPE STREQUAL "Release"))
set(OPTIMIZATION_FLAGS "${OPTIMIZATION_FLAGS} -flto")
endif()

Expand Down

0 comments on commit fde2da8

Please sign in to comment.