Skip to content

Commit

Permalink
Add CMake 3.20.0 and 3.19.7 (#587)
Browse files Browse the repository at this point in the history
* Add CMake 3.20.0 and 3.19.7

* Update docs
  • Loading branch information
jsharpe authored Mar 28, 2021
1 parent 5dbe642 commit 322732b
Show file tree
Hide file tree
Showing 5 changed files with 313 additions and 61 deletions.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,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.19.6"</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.0"</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> |
Expand Down
2 changes: 1 addition & 1 deletion foreign_cc/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ load("//toolchains:toolchains.bzl", "built_toolchains", "prebuilt_toolchains", "
def rules_foreign_cc_dependencies(
native_tools_toolchains = [],
register_default_tools = True,
cmake_version = "3.19.6",
cmake_version = "3.20.0",
make_version = "4.3",
ninja_version = "1.10.2",
register_preinstalled_tools = True,
Expand Down
28 changes: 27 additions & 1 deletion toolchains/built_toolchains.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,33 @@ def _cmake_toolchain(version):
native.register_toolchains(
"@rules_foreign_cc//toolchains:built_cmake_toolchain",
)
if version == "3.19.6":
if "3.20.0" == version:
maybe(
http_archive,
name = "cmake_src",
build_file_content = _ALL_CONTENT,
sha256 = "9c06b2ddf7c337e31d8201f6ebcd3bba86a9a033976a9aee207fe0c6971f4755",
strip_prefix = "cmake-3.20.0",
urls = [
"https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0.tar.gz",
],
)
return

if "3.19.7" == version:
maybe(
http_archive,
name = "cmake_src",
build_file_content = _ALL_CONTENT,
sha256 = "58a15f0d56a0afccc3cc5371234fce73fcc6c8f9dbd775d898e510b83175588e",
strip_prefix = "cmake-3.19.7",
urls = [
"https://github.com/Kitware/CMake/releases/download/v3.19.7/cmake-3.19.7.tar.gz",
],
)
return

if "3.19.6" == version:
maybe(
http_archive,
name = "cmake_src",
Expand Down
Loading

0 comments on commit 322732b

Please sign in to comment.