From 05a06fe7a3a68830b9d7ef45afd6c95ae8df5793 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 2 Aug 2025 01:14:09 +0200 Subject: [PATCH] build: Allow LTO to work again --- cmake/build_helpers.cmake | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake index 52abc409c..6593cd246 100644 --- a/cmake/build_helpers.cmake +++ b/cmake/build_helpers.cmake @@ -474,6 +474,18 @@ macro(configureCMake) message(WARNING "ninja not found, using default generator!") endif () endif() +endmacro() + +function(configureProject) + # Enable C and C++ languages + enable_language(C CXX) + + if (XCODE) + # Support Xcode's multi configuration paradigm by placing built artifacts into separate directories + set(IMHEX_MAIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Configs/$" PARENT_SCOPE) + else() + set(IMHEX_MAIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" PARENT_SCOPE) + endif() # Enable LTO if desired and supported if (IMHEX_ENABLE_LTO) @@ -487,18 +499,6 @@ macro(configureCMake) message(WARNING "LTO is not supported: ${output_error}") endif () endif () -endmacro() - -function(configureProject) - # Enable C and C++ languages - enable_language(C CXX) - - if (XCODE) - # Support Xcode's multi configuration paradigm by placing built artifacts into separate directories - set(IMHEX_MAIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Configs/$" PARENT_SCOPE) - else() - set(IMHEX_MAIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" PARENT_SCOPE) - endif() endfunction() macro(setDefaultBuiltTypeIfUnset)