Skip to content

Commit

Permalink
fixs
Browse files Browse the repository at this point in the history
  • Loading branch information
beats-dh committed Oct 13, 2024
1 parent 7992289 commit 3ccb7f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
16 changes: 9 additions & 7 deletions cmake/modules/BaseConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down

0 comments on commit 3ccb7f3

Please sign in to comment.