Skip to content

Commit 8c4ac1e

Browse files
committed
Update CMake gates for 4.2 and fix CI toolchain paths
1 parent c309849 commit 8c4ac1e

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

.github/workflows/Build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,12 @@ jobs:
111111
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
112112
fi
113113
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
114-
brew install gcc@15
114+
brew install gcc@15 binutils
115115
GCC_HOME=$(brew --prefix gcc@15)
116116
echo "CC=$GCC_HOME/bin/gcc-15" >> "$GITHUB_ENV"
117117
echo "CXX=$GCC_HOME/bin/g++-15" >> "$GITHUB_ENV"
118118
echo "$GCC_HOME/bin" >> "$GITHUB_PATH"
119+
echo "$(brew --prefix binutils)/bin" >> "$GITHUB_PATH"
119120
fi
120121
else
121122
wget -q https://apt.llvm.org/llvm.sh
@@ -131,7 +132,7 @@ jobs:
131132
done
132133
echo "CC=clang-21" >> "$GITHUB_ENV"
133134
echo "CXX=clang++-21" >> "$GITHUB_ENV"
134-
echo "CXXFLAGS=-stdlib=libc++" >> "$GITHUB_ENV"
135+
echo "CXXFLAGS=-stdlib=libc++ -isystem /usr/include/c++/v1" >> "$GITHUB_ENV"
135136
echo "LDFLAGS=-stdlib=libc++" >> "$GITHUB_ENV"
136137
fi
137138
elif [ "$RUNNER_OS" == "macOS" ]; then

CMakeLists.txt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@
1515
# ----------------------------------------------------------------------------
1616

1717
cmake_minimum_required(VERSION 4.0.2 FATAL_ERROR)
18-
# The specific value used for CMake==4.0.2
19-
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD
20-
# This specific value changes as experimental support evolves. See
21-
# `Help/dev/experimental.rst` in the CMake source corresponding to
22-
# your CMake build for the exact value to use.
23-
"a9e1cf81-9932-4810-974b-6eccaf14e457")
24-
set(CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE 4bd552e2-b7fb-429a-ab23-c83ef53f3f13)
18+
# The specific values used for experimental CMake features.
19+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.2")
20+
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "d0edc3af-4c50-42ea-a356-e2862fe7a444")
21+
set(CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE "73194a1d-c0b5-41b9-9190-a4512925e192")
22+
else()
23+
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD
24+
# This specific value changes as experimental support evolves. See
25+
# `Help/dev/experimental.rst` in the CMake source corresponding to
26+
# your CMake build for the exact value to use.
27+
"a9e1cf81-9932-4810-974b-6eccaf14e457")
28+
set(CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE 4bd552e2-b7fb-429a-ab23-c83ef53f3f13)
29+
endif()
2530
set(CMAKE_EXPORT_BUILD_DATABASE 1)
2631

2732
# ----------------------------------------------------------------------------
@@ -41,9 +46,6 @@ project(opflow VERSION ${OPFLOW_VERSION} LANGUAGES C CXX)
4146
set(OPFLOW_VERSION_STRING "${OPFLOW_VERSION} - ${SHORT_SHA1} - ${GIT_CHANGE}")
4247
message(STATUS "Build opflow: ${OPFLOW_VERSION_STRING}")
4348

44-
set(CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE 4bd552e2-b7fb-429a-ab23-c83ef53f3f13)
45-
set(CMAKE_EXPORT_BUILD_DATABASE 1)
46-
4749
set(CMAKE_CXX_MODULE_STD 1)
4850

4951
include(GNUInstallDirs)

0 commit comments

Comments
 (0)