Skip to content

Commit d90ab21

Browse files
committed
Safer way to enable LTO
1 parent f48765c commit d90ab21

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ endif()
7878

7979
project(plugdata VERSION 0.9.3 LANGUAGES C CXX)
8080

81+
include(CheckIPOSupported)
82+
check_ipo_supported(RESULT ipo_supported OUTPUT ipo_error)
83+
84+
if (ipo_supported)
85+
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION
86+
$<$<CONFIG:Release>:TRUE>)
87+
endif()
88+
8189
if(QUICK_BUILD)
8290
set(ENABLE_SFIZZ OFF)
8391
set(ENABLE_GEM OFF)
@@ -320,8 +328,6 @@ target_link_libraries(juce
320328
)
321329
endif()
322330

323-
target_compile_options(juce PUBLIC $<$<CONFIG:Release>:${JUCE_LTO_FLAGS}>)
324-
325331
if(NANOVG_METAL_IMPLEMENTATION)
326332
add_compile_definitions(NANOVG_METAL_IMPLEMENTATION=1)
327333
elseif(NANOVG_GLES_IMPLEMENTATION)

0 commit comments

Comments
 (0)