Skip to content

Commit 48c62ad

Browse files
Only apply LTO on release
1 parent b3d4136 commit 48c62ad

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

CMakeLists.txt

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
2929

3030
add_executable(pepv src/main.cpp src/pkgs.cpp src/utils.cpp src/events.cpp)
3131

32-
include(CheckIPOSupported)
33-
check_ipo_supported(RESULT supported OUTPUT error)
34-
35-
if( supported )
36-
message(STATUS "IPO / LTO enabled")
37-
set_property(TARGET pepv PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
38-
else()
39-
message(STATUS "IPO / LTO not supported: <${error}>")
32+
33+
if(CMAKE_BUILD_TYPE STREQUAL "Release")
34+
include(CheckIPOSupported)
35+
check_ipo_supported(RESULT supported OUTPUT error)
36+
37+
if(supported)
38+
message(STATUS "IPO / LTO enabled")
39+
set_property(TARGET pepv PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
40+
else()
41+
message(STATUS "IPO / LTO not supported: <${error}>")
42+
endif()
4043
endif()
4144

4245
target_link_libraries(pepv PRIVATE ${GTK3_LIBRARIES} Tracy::TracyClient)

0 commit comments

Comments
 (0)