From 3ccb7f3989bd57d96757fb605131391774a5936a Mon Sep 17 00:00:00 2001 From: Beats Date: Sat, 12 Oct 2024 21:56:24 -0400 Subject: [PATCH] fixs --- .github/workflows/build-ubuntu.yml | 4 ++-- cmake/modules/BaseConfig.cmake | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 291db8d4999..6a252630f48 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -50,7 +50,7 @@ jobs: - name: Install Linux Dependencies run: > - sudo apt-get update && sudo apt-get install ccache linux-headers-$(uname -r) + sudo apt-get update && sudo apt-get install ccache linux-headers-"$(uname -r)" - name: Switch to gcc-12 on Ubuntu 22.04 if: matrix.os == 'ubuntu-22.04' @@ -81,7 +81,7 @@ jobs: run: | vcpkgCommitId=$(grep '.builtin-baseline' vcpkg.json | awk -F: '{print $2}' | tr -d '," ') echo "vcpkg commit ID: $vcpkgCommitId" - echo "VCPKG_GIT_COMMIT_ID=$vcpkgCommitId" >> $GITHUB_ENV + echo "VCPKG_GIT_COMMIT_ID=$vcpkgCommitId" >> "$GITHUB_ENV" - name: Get vcpkg commit id from vcpkg.json uses: lukka/run-vcpkg@main diff --git a/cmake/modules/BaseConfig.cmake b/cmake/modules/BaseConfig.cmake index 6a08fffac1e..e772f78b3a1 100644 --- a/cmake/modules/BaseConfig.cmake +++ b/cmake/modules/BaseConfig.cmake @@ -151,7 +151,7 @@ function(configure_linking target_name) if(ipo_supported) set_property(TARGET ${target_name} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) - log_option_enabled(STATUS "IPO/LTO enabled for target ${target_name}.") + log_option_enabled("IPO/LTO enabled for target ${target_name}.") if(MSVC) target_compile_options(${target_name} PRIVATE /GL) @@ -160,17 +160,19 @@ function(configure_linking target_name) # Check if it's running on Linux, using GCC 14, and in Debug mode if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND - GCC_VERSION VERSION_GREATER_EQUAL "14" AND - GCC_VERSION VERSION_LESS "15" AND + GCC_VERSION VERSION_EQUAL "14" AND CMAKE_BUILD_TYPE STREQUAL "Debug") - log_option_disabled(WARNING "LTO disabled for GCC 14 in Debug mode on Linux for target ${target_name}.") + log_option_disabled("LTO disabled for GCC 14 in Debug mode on Linux for target ${target_name}.") + # Disable LTO for Debug builds with GCC 14 + target_compile_options(${target_name} PRIVATE -fno-lto) + target_link_options(${target_name} PRIVATE -fno-lto) else() - target_compile_options(${target_name} PRIVATE -flto) - target_link_options(${target_name} PRIVATE -flto) + target_compile_options(${target_name} PRIVATE -flto=auto) + target_link_options(${target_name} PRIVATE -flto=auto) endif() endif() else() - log_option_disabled(WARNING "IPO/LTO is not supported for target ${target_name}: ${ipo_output}") + log_option_disabled("IPO/LTO is not supported for target ${target_name}: ${ipo_output}") endif() endif() endfunction()