diff --git a/docs/README.md b/docs/README.md
index 70e27091e..331c816f4 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -418,7 +418,7 @@ Call this function from the WORKSPACE file to initialize rules_foreign_cc de
| :------------- | :------------- | :------------- |
| native_tools_toolchains | pass the toolchains for toolchain types '@rules_foreign_cc//toolchains:cmake_toolchain' and '@rules_foreign_cc//toolchains:ninja_toolchain' with the needed platform constraints. If you do not pass anything, registered default toolchains will be selected (see below). | []
|
| register_default_tools | If True, the cmake and ninja toolchains, calling corresponding preinstalled binaries by name (cmake, ninja) will be registered after 'native_tools_toolchains' without any platform constraints. The default is True. | True
|
-| cmake_version | The target version of the cmake toolchain if register_default_tools
or register_built_tools
is set to True
. | "3.21.0"
|
+| cmake_version | The target version of the cmake toolchain if register_default_tools
or register_built_tools
is set to True
. | "3.21.2"
|
| make_version | The target version of the default make toolchain if register_built_tools
is set to True
. | "4.3"
|
| ninja_version | The target version of the ninja toolchain if register_default_tools
or register_built_tools
is set to True
. | "1.10.2"
|
| register_preinstalled_tools | If true, toolchains will be registered for the native built tools installed on the exec host | True
|
diff --git a/foreign_cc/repositories.bzl b/foreign_cc/repositories.bzl
index e5adcac44..56ed7c627 100644
--- a/foreign_cc/repositories.bzl
+++ b/foreign_cc/repositories.bzl
@@ -9,7 +9,7 @@ load("//toolchains:toolchains.bzl", "built_toolchains", "prebuilt_toolchains", "
def rules_foreign_cc_dependencies(
native_tools_toolchains = [],
register_default_tools = True,
- cmake_version = "3.21.1",
+ cmake_version = "3.21.2",
make_version = "4.3",
ninja_version = "1.10.2",
register_preinstalled_tools = True,
diff --git a/toolchains/built_toolchains.bzl b/toolchains/built_toolchains.bzl
index b19cd5e84..10f600e6b 100644
--- a/toolchains/built_toolchains.bzl
+++ b/toolchains/built_toolchains.bzl
@@ -25,6 +25,19 @@ def _cmake_toolchain(version):
native.register_toolchains(
"@rules_foreign_cc//toolchains:built_cmake_toolchain",
)
+ if "3.21.2" == version:
+ maybe(
+ http_archive,
+ name = "cmake_src",
+ build_file_content = _ALL_CONTENT,
+ sha256 = "94275e0b61c84bb42710f5320a23c6dcb2c6ee032ae7d2a616f53f68b3d21659",
+ strip_prefix = "cmake-3.21.2",
+ urls = [
+ "https://github.com/Kitware/CMake/releases/download/v3.21.2/cmake-3.21.2.tar.gz",
+ ],
+ )
+ return
+
if "3.21.1" == version:
maybe(
http_archive,
diff --git a/toolchains/prebuilt_toolchains.bzl b/toolchains/prebuilt_toolchains.bzl
index 4bf478311..2c307a960 100644
--- a/toolchains/prebuilt_toolchains.bzl
+++ b/toolchains/prebuilt_toolchains.bzl
@@ -65,6 +65,110 @@ def prebuilt_toolchains(cmake_version, ninja_version):
_make_toolchains()
def _cmake_toolchains(version):
+ if "3.21.2" == version:
+ maybe(
+ http_archive,
+ name = "cmake-3.21.2-linux-aarch64",
+ urls = [
+ "https://github.com/Kitware/CMake/releases/download/v3.21.2/cmake-3.21.2-linux-aarch64.tar.gz",
+ ],
+ sha256 = "fe0673c1877f31e37fd94bfe0509c2e4c13b9d5174dd953c2354549685e1d055",
+ strip_prefix = "cmake-3.21.2-linux-aarch64",
+ build_file_content = _CMAKE_BUILD_FILE.format(
+ bin = "cmake",
+ ),
+ )
+
+ maybe(
+ http_archive,
+ name = "cmake-3.21.2-linux-x86_64",
+ urls = [
+ "https://github.com/Kitware/CMake/releases/download/v3.21.2/cmake-3.21.2-linux-x86_64.tar.gz",
+ ],
+ sha256 = "d5517d949eaa8f10a149ca250e811e1473ee3f6f10935f1f69596a1e184eafc1",
+ strip_prefix = "cmake-3.21.2-linux-x86_64",
+ build_file_content = _CMAKE_BUILD_FILE.format(
+ bin = "cmake",
+ ),
+ )
+
+ maybe(
+ http_archive,
+ name = "cmake-3.21.2-macos-universal",
+ urls = [
+ "https://github.com/Kitware/CMake/releases/download/v3.21.2/cmake-3.21.2-macos-universal.tar.gz",
+ ],
+ sha256 = "25e3f439c19185f51136126a06e14b4873243ea1b4a37678881adde05433ae9b",
+ strip_prefix = "cmake-3.21.2-macos-universal/CMake.app/Contents",
+ build_file_content = _CMAKE_BUILD_FILE.format(
+ bin = "cmake",
+ ),
+ )
+
+ maybe(
+ http_archive,
+ name = "cmake-3.21.2-windows-i386",
+ urls = [
+ "https://github.com/Kitware/CMake/releases/download/v3.21.2/cmake-3.21.2-windows-i386.zip",
+ ],
+ sha256 = "9374249e8ca5cfe899f6a8dc95252e79242290e452b3ce12a88449560143b6e9",
+ strip_prefix = "cmake-3.21.2-windows-i386",
+ build_file_content = _CMAKE_BUILD_FILE.format(
+ bin = "cmake.exe",
+ ),
+ )
+
+ maybe(
+ http_archive,
+ name = "cmake-3.21.2-windows-x86_64",
+ urls = [
+ "https://github.com/Kitware/CMake/releases/download/v3.21.2/cmake-3.21.2-windows-x86_64.zip",
+ ],
+ sha256 = "213a4e6485b711cb0a48cbd97b10dfe161a46bfe37b8f3205f47e99ffec434d2",
+ strip_prefix = "cmake-3.21.2-windows-x86_64",
+ build_file_content = _CMAKE_BUILD_FILE.format(
+ bin = "cmake.exe",
+ ),
+ )
+
+ # buildifier: leave-alone
+ maybe(
+ prebuilt_toolchains_repository,
+ name = "cmake_3.21.2_toolchains",
+ repos = {
+ "cmake-3.21.2-linux-aarch64": [
+ "@platforms//cpu:aarch64",
+ "@platforms//os:linux",
+ ],
+ "cmake-3.21.2-linux-x86_64": [
+ "@platforms//cpu:x86_64",
+ "@platforms//os:linux",
+ ],
+ "cmake-3.21.2-macos-universal": [
+ "@platforms//os:macos",
+ ],
+ "cmake-3.21.2-windows-i386": [
+ "@platforms//cpu:x86_32",
+ "@platforms//os:windows",
+ ],
+ "cmake-3.21.2-windows-x86_64": [
+ "@platforms//cpu:x86_64",
+ "@platforms//os:windows",
+ ],
+ },
+ tool = "cmake",
+ )
+
+ native.register_toolchains(
+ "@cmake_3.21.2_toolchains//:cmake-3.21.2-linux-aarch64_toolchain",
+ "@cmake_3.21.2_toolchains//:cmake-3.21.2-linux-x86_64_toolchain",
+ "@cmake_3.21.2_toolchains//:cmake-3.21.2-macos-universal_toolchain",
+ "@cmake_3.21.2_toolchains//:cmake-3.21.2-windows-i386_toolchain",
+ "@cmake_3.21.2_toolchains//:cmake-3.21.2-windows-x86_64_toolchain",
+ )
+
+ return
+
if "3.21.1" == version:
maybe(
http_archive,
diff --git a/toolchains/prebuilt_toolchains.py b/toolchains/prebuilt_toolchains.py
index 9000ba879..36d8a849e 100755
--- a/toolchains/prebuilt_toolchains.py
+++ b/toolchains/prebuilt_toolchains.py
@@ -11,6 +11,7 @@
CMAKE_URL_TEMPLATE = "https://github.com/Kitware/CMake/releases/download/v{full}/{file}"
CMAKE_VERSIONS = [
+ "3.21.2",
"3.21.1",
"3.21.0",
"3.20.5",