commit bbb9a9e5ce0168b4e134118ef91ee1f9b142d851
parent e6b3f4d7c82976d89596cb95c7987fb845ffcbab
Author: Ryan VanderMeulen <rvandermeulen@mozilla.com>
Date: Mon, 10 Nov 2025 13:15:04 +0000
Bug 1998498 - Update CMake to v4.1.2. r=firefox-build-system-reviewers,ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D271475
Diffstat:
2 files changed, 36 insertions(+), 14 deletions(-)
diff --git a/taskcluster/kinds/fetch/toolchains.yml b/taskcluster/kinds/fetch/toolchains.yml
@@ -455,23 +455,23 @@ win64-ninja:
add-prefix: ninja/bin/
macosx64-cmake:
- description: cmake 3.25.1
+ description: cmake 4.1.2
fetch:
type: static-url
- url: https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1-macos-universal.tar.gz
- sha256: e95e75ea506189785355a7e8dd86b059780a5613b9e62ab6e7419d6bfba3510b
- size: 74418897
+ url: https://github.com/Kitware/CMake/releases/download/v4.1.2/cmake-4.1.2-macos-universal.tar.gz
+ sha256: 3be85f5b999e327b1ac7d804cbc9acd767059e9f603c42ec2765f6ab68fbd367
+ size: 80750689
artifact-name: cmake.tar.zst
strip-components: 3
add-prefix: cmake/
cmake:
- description: cmake 3.25.1 source code
+ description: cmake 4.1.2 source code
fetch:
type: static-url
- url: https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1.tar.gz
- sha256: 1c511d09516af493694ed9baf13c55947a36389674d657a2d5e0ccedc6b291d8
- size: 10561054
+ url: https://github.com/Kitware/CMake/releases/download/v4.1.2/cmake-4.1.2.tar.gz
+ sha256: 643f04182b7ba323ab31f526f785134fb79cba3188a852206ef0473fee282a15
+ size: 12048810
artifact-name: cmake.tar.zst
strip-components: 1
add-prefix: cmake/
diff --git a/taskcluster/scripts/misc/build-cmake.sh b/taskcluster/scripts/misc/build-cmake.sh
@@ -10,10 +10,10 @@ cd $MOZ_FETCHES_DIR/cmake
# Work around https://gitlab.kitware.com/cmake/cmake/-/issues/26031
patch -p1 <<'EOF'
diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx
-index 52e200c24f..07ccf3965c 100644
+index bbcb0bccc9..f5d80dd784 100644
--- a/Source/bindexplib.cxx
+++ b/Source/bindexplib.cxx
-@@ -398,7 +398,7 @@ static bool DumpFile(std::string const& nmPath, const char* filename,
+@@ -414,7 +414,7 @@ static bool DumpFile(std::string const& nmPath, char const* filename,
std::set<std::string>& symbols,
std::set<std::string>& dataSymbols)
{
@@ -28,17 +28,39 @@ EOF
# The resulting cmake works well enough for our use.
patch -p1 <<'EOF'
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
-index c268a92111..d18f8cf221 100644
+index c54da4408a..8408355c4a 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
-@@ -863,7 +863,6 @@ if(WIN32)
-
+@@ -964,7 +964,6 @@ if(WIN32)
+
# Add a manifest file to executables on Windows to allow for
# GetVersion to work properly on Windows 8 and above.
- target_sources(ManifestLib INTERFACE cmake.version.manifest)
endif()
endif()
-
+
+EOF
+
+# Work around https://github.com/llvm/llvm-project/issues/134237
+# Should be removable once we update to clang 21.
+patch -p1 <<'EOF'
+diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
+index 1948c63bad..cb4cefaa72 100644
+--- a/Modules/CMakeFindBinUtils.cmake
++++ b/Modules/CMakeFindBinUtils.cmake
+@@ -87,9 +87,9 @@ if(("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC" AND
+ if("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" MATCHES "^x(Clang|LLVMFlang)$")
+ set(_CMAKE_NM_NAMES "llvm-nm" "nm")
+ list(PREPEND _CMAKE_AR_NAMES "llvm-lib")
+- if("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_VERSION}" VERSION_GREATER_EQUAL 14.0.2)
+- list(PREPEND _CMAKE_MT_NAMES "llvm-mt")
+- endif()
++ # if("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_VERSION}" VERSION_GREATER_EQUAL 14.0.2)
++ # list(PREPEND _CMAKE_MT_NAMES "llvm-mt")
++ # endif()
+ list(PREPEND _CMAKE_LINKER_NAMES "lld-link")
+ list(APPEND _CMAKE_TOOL_VARS NM)
+ elseif("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" STREQUAL "xIntel")
EOF
export PATH="$MOZ_FETCHES_DIR/clang/bin:$PATH"