Skip to content

Commit bde5b7a

Browse files
cmake: disable LTO/IPO when testing is enabled, it's annoying waiting a million years to recompile
1 parent c656604 commit bde5b7a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,11 @@ endif()
106106
if(PROJECT_IS_TOP_LEVEL)
107107
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
108108

109-
include(CheckIPOSupported)
110-
check_ipo_supported(RESULT SOURCEPP_BUILD_WITH_LTO)
111-
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ${SOURCEPP_BUILD_WITH_LTO})
109+
if(NOT SOURCEPP_BUILD_TESTS)
110+
include(CheckIPOSupported)
111+
check_ipo_supported(RESULT SOURCEPP_BUILD_WITH_LTO)
112+
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ${SOURCEPP_BUILD_WITH_LTO})
113+
endif()
112114
endif()
113115

114116
if(SOURCEPP_USE_STATIC_MSVC_RUNTIME)

0 commit comments

Comments
 (0)