parent
32b0c10972
commit
b9685b507e
|
@ -417,7 +417,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.20.1"</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.20.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> |
|
||||
|
|
|
@ -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.20.1",
|
||||
cmake_version = "3.20.2",
|
||||
make_version = "4.3",
|
||||
ninja_version = "1.10.2",
|
||||
register_preinstalled_tools = True,
|
||||
|
|
|
@ -25,6 +25,19 @@ def _cmake_toolchain(version):
|
|||
native.register_toolchains(
|
||||
"@rules_foreign_cc//toolchains:built_cmake_toolchain",
|
||||
)
|
||||
if "3.20.2" == version:
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "cmake_src",
|
||||
build_file_content = _ALL_CONTENT,
|
||||
sha256 = "aecf6ecb975179eb3bb6a4a50cae192d41e92b9372b02300f9e8f1d5f559544e",
|
||||
strip_prefix = "cmake-3.20.2",
|
||||
urls = [
|
||||
"https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2.tar.gz",
|
||||
],
|
||||
)
|
||||
return
|
||||
|
||||
if "3.20.1" == version:
|
||||
maybe(
|
||||
http_archive,
|
||||
|
|
|
@ -65,6 +65,110 @@ def prebuilt_toolchains(cmake_version, ninja_version):
|
|||
_make_toolchains()
|
||||
|
||||
def _cmake_toolchains(version):
|
||||
if "3.20.2" == version:
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "cmake-3.20.2-linux-aarch64",
|
||||
urls = [
|
||||
"https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2-linux-aarch64.tar.gz",
|
||||
],
|
||||
sha256 = "688a3ece018384966fed99a706bc8fbbbc50220393dce1531af36e640c46f601",
|
||||
strip_prefix = "cmake-3.20.2-linux-aarch64",
|
||||
build_file_content = _CMAKE_BUILD_FILE.format(
|
||||
bin = "cmake",
|
||||
),
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "cmake-3.20.2-linux-x86_64",
|
||||
urls = [
|
||||
"https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2-linux-x86_64.tar.gz",
|
||||
],
|
||||
sha256 = "3f827544f9c82e74ddf5016461fdfcfea4ede58a26f82612f473bf6bfad8bfc2",
|
||||
strip_prefix = "cmake-3.20.2-linux-x86_64",
|
||||
build_file_content = _CMAKE_BUILD_FILE.format(
|
||||
bin = "cmake",
|
||||
),
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "cmake-3.20.2-macos-universal",
|
||||
urls = [
|
||||
"https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2-macos-universal.tar.gz",
|
||||
],
|
||||
sha256 = "0100663380a3bd977b001183cd487412db7aad9de6859927bde97e1e6e44e645",
|
||||
strip_prefix = "cmake-3.20.2-macos-universal/CMake.app/Contents",
|
||||
build_file_content = _CMAKE_BUILD_FILE.format(
|
||||
bin = "cmake",
|
||||
),
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "cmake-3.20.2-windows-i386",
|
||||
urls = [
|
||||
"https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2-windows-i386.zip",
|
||||
],
|
||||
sha256 = "8ad1f1f9a1a0a0dc82107eb9a4351d91d4e72504b0343368f1569b72a5e48bc1",
|
||||
strip_prefix = "cmake-3.20.2-windows-i386",
|
||||
build_file_content = _CMAKE_BUILD_FILE.format(
|
||||
bin = "cmake.exe",
|
||||
),
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "cmake-3.20.2-windows-x86_64",
|
||||
urls = [
|
||||
"https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2-windows-x86_64.zip",
|
||||
],
|
||||
sha256 = "15a49e2ab81c1822d75b1b1a92f7863f58e31f6d6aac1c4103eef2b071be3112",
|
||||
strip_prefix = "cmake-3.20.2-windows-x86_64",
|
||||
build_file_content = _CMAKE_BUILD_FILE.format(
|
||||
bin = "cmake.exe",
|
||||
),
|
||||
)
|
||||
|
||||
# buildifier: leave-alone
|
||||
maybe(
|
||||
prebuilt_toolchains_repository,
|
||||
name = "cmake_3.20.2_toolchains",
|
||||
repos = {
|
||||
"cmake-3.20.2-linux-aarch64": [
|
||||
"@platforms//cpu:aarch64",
|
||||
"@platforms//os:linux",
|
||||
],
|
||||
"cmake-3.20.2-linux-x86_64": [
|
||||
"@platforms//cpu:x86_64",
|
||||
"@platforms//os:linux",
|
||||
],
|
||||
"cmake-3.20.2-macos-universal": [
|
||||
"@platforms//os:macos",
|
||||
],
|
||||
"cmake-3.20.2-windows-i386": [
|
||||
"@platforms//cpu:x86_32",
|
||||
"@platforms//os:windows",
|
||||
],
|
||||
"cmake-3.20.2-windows-x86_64": [
|
||||
"@platforms//cpu:x86_64",
|
||||
"@platforms//os:windows",
|
||||
],
|
||||
},
|
||||
tool = "cmake",
|
||||
)
|
||||
|
||||
native.register_toolchains(
|
||||
"@cmake_3.20.2_toolchains//:cmake-3.20.2-linux-aarch64_toolchain",
|
||||
"@cmake_3.20.2_toolchains//:cmake-3.20.2-linux-x86_64_toolchain",
|
||||
"@cmake_3.20.2_toolchains//:cmake-3.20.2-macos-universal_toolchain",
|
||||
"@cmake_3.20.2_toolchains//:cmake-3.20.2-windows-i386_toolchain",
|
||||
"@cmake_3.20.2_toolchains//:cmake-3.20.2-windows-x86_64_toolchain",
|
||||
)
|
||||
|
||||
return
|
||||
|
||||
if "3.20.1" == version:
|
||||
maybe(
|
||||
http_archive,
|
||||
|
|
|
@ -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.20.2",
|
||||
"3.20.1",
|
||||
"3.20.0",
|
||||
"3.19.8",
|
||||
|
|
Loading…
Reference in New Issue