Fixes to cmake toolchain so it can find CMAKE_ROOT correctly (#547)

This commit is contained in:
James Sharpe 2021-03-09 15:21:10 +00:00 committed by GitHub
parent 175b29c6f7
commit b7c0461a66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 23 deletions

View File

@ -28,16 +28,10 @@ filegroup(
), ),
) )
filegroup(
name = "cmake_bin",
srcs = ["bin/{bin}"],
data = [":cmake_data"],
)
native_tool_toolchain( native_tool_toolchain(
name = "cmake_tool", name = "cmake_tool",
path = "$(execpath :cmake_bin)", path = "bin/{bin}",
target = ":cmake_bin", target = ":cmake_data",
) )
""" """

View File

@ -133,16 +133,10 @@ filegroup(
), ),
) )
filegroup(
name = "cmake_bin",
srcs = ["bin/{{bin}}"],
data = [":cmake_data"],
)
native_tool_toolchain( native_tool_toolchain(
name = "cmake_tool", name = "cmake_tool",
path = "$(execpath :cmake_bin)", path = "bin/{bin}",
target = ":cmake_bin", target = ":cmake_data",
) )
\"\"\" \"\"\"

View File

@ -7,16 +7,10 @@ load("@rules_foreign_cc//tools/build_defs/native_tools:native_tools_toolchain.bz
""" """
_TOOLCHAIN = """\ _TOOLCHAIN = """\
native_tool_toolchain(
name = "{repo}_tool",
path = "$(execpath @{repo}//:{tool}_bin)",
target = "@{repo}//:{tool}_bin",
)
toolchain( toolchain(
name = "{repo}_toolchain", name = "{repo}_toolchain",
exec_compatible_with = {exec_compatible_with}, exec_compatible_with = {exec_compatible_with},
toolchain = ":{repo}_tool", toolchain = "@{repo}//:{tool}_tool",
toolchain_type = "@rules_foreign_cc//tools/build_defs:{tool}_toolchain", toolchain_type = "@rules_foreign_cc//tools/build_defs:{tool}_toolchain",
) )
""" """