Skip to content

Commit

Permalink
CMake 3.22.1 (#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsharpe authored Jan 1, 2022
1 parent 3c14ef4 commit 5f37b42
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 1 deletion.
2 changes: 1 addition & 1 deletion foreign_cc/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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.22.0",
cmake_version = "3.22.1",
make_version = "4.3",
ninja_version = "1.10.2",
register_preinstalled_tools = True,
Expand Down
1 change: 1 addition & 0 deletions toolchains/built_toolchains.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ _CMAKE_SRCS = {
"3.21.3": [["https://github.com/Kitware/CMake/releases/download/v3.21.3/cmake-3.21.3.tar.gz"], "cmake-3.21.3", "d14d06df4265134ee42c4d50f5a60cb8b471b7b6a47da8e5d914d49dd783794f"],
"3.21.4": [["https://github.com/Kitware/CMake/releases/download/v3.21.4/cmake-3.21.4.tar.gz"], "cmake-3.21.4", "d9570a95c215f4c9886dd0f0564ca4ef8d18c30750f157238ea12669c2985978"],
"3.22.0": [["https://github.com/Kitware/CMake/releases/download/v3.22.0/cmake-3.22.0.tar.gz"], "cmake-3.22.0", "998c7ba34778d2dfdb3df8a695469e24b11e2bfa21fbe41b361a3f45e1c9345e"],
"3.22.1": [["https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1.tar.gz"], "cmake-3.22.1", "0e998229549d7b3f368703d20e248e7ee1f853910d42704aa87918c213ea82c0"],
}

# buildifier: disable=unnamed-macro
Expand Down
105 changes: 105 additions & 0 deletions toolchains/prebuilt_toolchains.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,111 @@ def prebuilt_toolchains(cmake_version, ninja_version, register_toolchains):
_make_toolchains(register_toolchains)

def _cmake_toolchains(version, register_toolchains):
if "3.22.1" == version:
maybe(
http_archive,
name = "cmake-3.22.1-linux-aarch64",
urls = [
"https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-linux-aarch64.tar.gz",
],
sha256 = "601443375aa1a48a1a076bda7e3cca73af88400463e166fffc3e1da3ce03540b",
strip_prefix = "cmake-3.22.1-linux-aarch64",
build_file_content = _CMAKE_BUILD_FILE.format(
bin = "cmake",
),
)

maybe(
http_archive,
name = "cmake-3.22.1-linux-x86_64",
urls = [
"https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-linux-x86_64.tar.gz",
],
sha256 = "73565c72355c6652e9db149249af36bcab44d9d478c5546fd926e69ad6b43640",
strip_prefix = "cmake-3.22.1-linux-x86_64",
build_file_content = _CMAKE_BUILD_FILE.format(
bin = "cmake",
),
)

maybe(
http_archive,
name = "cmake-3.22.1-macos-universal",
urls = [
"https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-macos-universal.tar.gz",
],
sha256 = "9ba46ce69d524f5bcdf98076a6b01f727604fb31cf9005ec03dea1cf16da9514",
strip_prefix = "cmake-3.22.1-macos-universal/CMake.app/Contents",
build_file_content = _CMAKE_BUILD_FILE.format(
bin = "cmake",
),
)

maybe(
http_archive,
name = "cmake-3.22.1-windows-i386",
urls = [
"https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-windows-i386.zip",
],
sha256 = "f53494e3b35e5a1177ad55c28763eb5bb45772c1d80778c0f96c45ce4376b6e8",
strip_prefix = "cmake-3.22.1-windows-i386",
build_file_content = _CMAKE_BUILD_FILE.format(
bin = "cmake.exe",
),
)

maybe(
http_archive,
name = "cmake-3.22.1-windows-x86_64",
urls = [
"https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-windows-x86_64.zip",
],
sha256 = "35fbbb7d9ffa491834bbc79cdfefc6c360088a3c9bf55c29d111a5afa04cdca3",
strip_prefix = "cmake-3.22.1-windows-x86_64",
build_file_content = _CMAKE_BUILD_FILE.format(
bin = "cmake.exe",
),
)

# buildifier: leave-alone
maybe(
prebuilt_toolchains_repository,
name = "cmake_3.22.1_toolchains",
repos = {
"cmake-3.22.1-linux-aarch64": [
"@platforms//cpu:aarch64",
"@platforms//os:linux",
],
"cmake-3.22.1-linux-x86_64": [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
],
"cmake-3.22.1-macos-universal": [
"@platforms//os:macos",
],
"cmake-3.22.1-windows-i386": [
"@platforms//cpu:x86_32",
"@platforms//os:windows",
],
"cmake-3.22.1-windows-x86_64": [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
},
tool = "cmake",
)

if (register_toolchains):
native.register_toolchains(
"@cmake_3.22.1_toolchains//:cmake-3.22.1-linux-aarch64_toolchain",
"@cmake_3.22.1_toolchains//:cmake-3.22.1-linux-x86_64_toolchain",
"@cmake_3.22.1_toolchains//:cmake-3.22.1-macos-universal_toolchain",
"@cmake_3.22.1_toolchains//:cmake-3.22.1-windows-i386_toolchain",
"@cmake_3.22.1_toolchains//:cmake-3.22.1-windows-x86_64_toolchain",
)

return

if "3.22.0" == version:
maybe(
http_archive,
Expand Down
1 change: 1 addition & 0 deletions toolchains/prebuilt_toolchains.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
CMAKE_URL_TEMPLATE = "https://github.com/Kitware/CMake/releases/download/v{full}/{file}"

CMAKE_VERSIONS = [
"3.22.1",
"3.22.0",
"3.21.4",
"3.21.3",
Expand Down

0 comments on commit 5f37b42

Please sign in to comment.