Add cmake version 3.21.2 (#778)

This commit is contained in:
James Sharpe 2021-08-28 21:16:01 +01:00 committed by GitHub
parent da8952e27c
commit 8f6fc67384
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 120 additions and 2 deletions

View File

@ -418,7 +418,7 @@ Call this function from the WORKSPACE file to initialize rules_foreign_cc de
| :------------- | :------------- | :------------- |
| <a id="rules_foreign_cc_dependencies-native_tools_toolchains"></a>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). | <code>[]</code> |
| <a id="rules_foreign_cc_dependencies-register_default_tools"></a>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. | <code>True</code> |
| <a id="rules_foreign_cc_dependencies-cmake_version"></a>cmake_version | The target version of the cmake toolchain if <code>register_default_tools</code> or <code>register_built_tools</code> is set to <code>True</code>. | <code>"3.21.0"</code> |
| <a id="rules_foreign_cc_dependencies-cmake_version"></a>cmake_version | The target version of the cmake toolchain if <code>register_default_tools</code> or <code>register_built_tools</code> is set to <code>True</code>. | <code>"3.21.2"</code> |
| <a id="rules_foreign_cc_dependencies-make_version"></a>make_version | The target version of the default make toolchain if <code>register_built_tools</code> is set to <code>True</code>. | <code>"4.3"</code> |
| <a id="rules_foreign_cc_dependencies-ninja_version"></a>ninja_version | The target version of the ninja toolchain if <code>register_default_tools</code> or <code>register_built_tools</code> is set to <code>True</code>. | <code>"1.10.2"</code> |
| <a id="rules_foreign_cc_dependencies-register_preinstalled_tools"></a>register_preinstalled_tools | If true, toolchains will be registered for the native built tools installed on the exec host | <code>True</code> |

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -11,6 +11,7 @@ CMAKE_SHA256_URL_TEMPLATE = "https://cmake.org/files/v{minor}/cmake-{full}-SHA-2
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",