Skip to content

Commit

Permalink
fix: expose CMAKE env variable from cmake toolchains (#911)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
roman-kashitsyn authored May 18, 2022
1 parent 78c5f77 commit 324dbd1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions toolchains/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 324dbd1

Please sign in to comment.