fix: expose CMAKE env variable from cmake toolchains (#911)

This change updates the definitions of cmake toolchains to expose CMAKE
environment variable that makes it easier to integrate the toolchain
with other build rules (e.g., with rules_rust).
This commit is contained in:
Roman Kashitsyn 2022-05-18 23:20:24 +02:00 committed by GitHub
parent 78c5f77385
commit 324dbd13cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -148,6 +148,10 @@ native_tool_toolchain(
native_tool_toolchain(
name = "preinstalled_cmake",
env = select({
"@platforms//os:windows": {"CMAKE": "cmake.exe"},
"//conditions:default": {"CMAKE": "cmake"},
}),
path = select({
"@platforms//os:windows": "cmake.exe",
"//conditions:default": "cmake",
@ -162,6 +166,10 @@ cmake_tool(
native_tool_toolchain(
name = "built_cmake",
env = select({
"@platforms//os:windows": {"CMAKE": "$(execpath :cmake_tool)/bin/cmake.exe"},
"//conditions:default": {"CMAKE": "$(execpath :cmake_tool)/bin/cmake"},
}),
path = select({
"@platforms//os:windows": "$(execpath :cmake_tool)/bin/cmake.exe",
"//conditions:default": "$(execpath :cmake_tool)/bin/cmake",