From 08b02cb7d23d06b0bcf3310162a88cd4acbd5c68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Tue, 27 Sep 2022 15:37:28 +0300 Subject: [PATCH] rename absolute_path to zig_path this is not an absolute path. --- toolchain/BUILD.sdk.bazel | 2 +- toolchain/defs.bzl | 2 +- toolchain/private/cc_toolchains.bzl | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/toolchain/BUILD.sdk.bazel b/toolchain/BUILD.sdk.bazel index ef5fd5f..56d245a 100644 --- a/toolchain/BUILD.sdk.bazel +++ b/toolchain/BUILD.sdk.bazel @@ -17,6 +17,6 @@ exports_files([ declare_cc_toolchains( os = {os}, - absolute_path = {absolute_path}, + zig_sdk_path = {zig_sdk_path}, zig_include_root = {zig_include_root}, ) diff --git a/toolchain/defs.bzl b/toolchain/defs.bzl index 25ca20a..0aba0fb 100644 --- a/toolchain/defs.bzl +++ b/toolchain/defs.bzl @@ -213,7 +213,7 @@ def _zig_repository_impl(repository_ctx): Label(src), executable = False, substitutions = { - "{absolute_path}": _quote("external/zig_sdk"), + "{zig_sdk_path}": _quote("external/zig_sdk"), "{os}": _quote(os), "{zig_include_root}": _quote(zig_include_root), }, diff --git a/toolchain/private/cc_toolchains.bzl b/toolchain/private/cc_toolchains.bzl index a5b4b5e..fd1db95 100644 --- a/toolchain/private/cc_toolchains.bzl +++ b/toolchain/private/cc_toolchains.bzl @@ -11,14 +11,14 @@ DEFAULT_TOOL_PATHS = { "strip": "/usr/bin/false", }.items() -def declare_cc_toolchains(os, absolute_path, zig_include_root): +def declare_cc_toolchains(os, zig_sdk_path, zig_include_root): for target_config in target_structs(): gotarget = target_config.gotarget zigtarget = target_config.zigtarget cxx_builtin_include_directories = [] for d in getattr(target_config, "toplevel_include", []): - cxx_builtin_include_directories.append(absolute_path + "/" + d) + cxx_builtin_include_directories.append(zig_sdk_path + "/" + d) absolute_tool_paths = {} for name, path in target_config.tool_paths.items() + DEFAULT_TOOL_PATHS: @@ -32,9 +32,9 @@ def declare_cc_toolchains(os, absolute_path, zig_include_root): dynamic_library_linkopts = target_config.dynamic_library_linkopts copts = target_config.copts for s in getattr(target_config, "linker_version_scripts", []): - linkopts = linkopts + ["-Wl,--version-script,%s/%s" % (absolute_path, s)] + linkopts = linkopts + ["-Wl,--version-script,%s/%s" % (zig_sdk_path, s)] for incl in getattr(target_config, "compiler_extra_includes", []): - copts = copts + ["-include", absolute_path + "/" + incl] + copts = copts + ["-include", zig_sdk_path + "/" + incl] zig_cc_toolchain_config( name = zigtarget + "_cc_config",