Skip to content

Commit 4b2fea4

Browse files
authored
Fix CMake CI jobs (#2953)
1 parent 0f575d6 commit 4b2fea4

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/docker_images/cmake_build_versions/cmake_build.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,21 @@ echo "Building CMake Version: ${CMAKE_VERSION:-unknown}"
99

1010
NUM_CPU_THREADS=$(grep -c ^processor /proc/cpuinfo)
1111

12-
# At the moment this works fine for all versions, in the future build logic can be modified to
13-
# look at it ${CMAKE_VERSION}.
14-
./configure --prefix=/opt/cmake --system-curl --system-libarchive
12+
# CMake versions before 4.0 have compatibility issues with newer system curl libraries.
13+
# The curl headers define CURL_NETRC_* as long int values, but older CMake code expects
14+
# them to be CURL_NETRC_OPTION enum values, causing compilation errors.
15+
# For older versions, we use CMake's bundled curl instead of the system curl.
16+
CONFIGURE_OPTS="--prefix=/opt/cmake --system-libarchive"
17+
18+
if [[ "${CMAKE_VERSION}" =~ ^[0-3]\. ]]; then
19+
# CMake versions 3.x and earlier: use bundled curl to avoid compatibility issues
20+
echo "Using bundled curl for CMake ${CMAKE_VERSION}"
21+
else
22+
# CMake 4.0 and later: safe to use system curl
23+
echo "Using system curl for CMake ${CMAKE_VERSION}"
24+
CONFIGURE_OPTS="${CONFIGURE_OPTS} --system-curl"
25+
fi
26+
27+
./configure ${CONFIGURE_OPTS}
1528
make -j"${NUM_CPU_THREADS}"
16-
make install
29+
make install

0 commit comments

Comments
 (0)