2
0
Fork 0
mirror of https://github.com/bazel-contrib/rules_foreign_cc synced 2024-11-28 08:43:26 +00:00

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

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