From ae2746ebebc4e8d5c9d9638f0d1f858708002681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Thu, 13 Oct 2022 06:11:19 +0300 Subject: [PATCH] zig_include_root: support windows too No real change, just make the logic consistent with Linux/Darwin. This prepares us for windows-aarch64, which will probably have lib in lib/zig. --- toolchain/defs.bzl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/toolchain/defs.bzl b/toolchain/defs.bzl index 7ccde3a..e338006 100644 --- a/toolchain/defs.bzl +++ b/toolchain/defs.bzl @@ -95,10 +95,10 @@ _ZIG_TOOLS = [ _ZIG_TOOL_WRAPPER_WINDOWS_CACHE_KNOWN = """@echo off if exist "external\\zig_sdk\\lib\\*" goto :have_external_zig_sdk_lib -set ZIG_LIB_DIR=%~dp0\\..\\..\\lib +set ZIG_LIB_DIR=%~dp0\\..\\..\\{zig_include_root} goto :set_zig_lib_dir :have_external_zig_sdk_lib -set ZIG_LIB_DIR=external\\zig_sdk\\lib +set ZIG_LIB_DIR=external\\zig_sdk\\{zig_include_root} :set_zig_lib_dir set ZIG_LOCAL_CACHE_DIR={cache_prefix}\\bazel-zig-cc set ZIG_GLOBAL_CACHE_DIR=%ZIG_LOCAL_CACHE_DIR% @@ -107,10 +107,10 @@ set ZIG_GLOBAL_CACHE_DIR=%ZIG_LOCAL_CACHE_DIR% _ZIG_TOOL_WRAPPER_WINDOWS_CACHE_GUESS = """@echo off if exist "external\\zig_sdk\\lib\\*" goto :have_external_zig_sdk_lib -set ZIG_LIB_DIR=%~dp0\\..\\..\\lib +set ZIG_LIB_DIR=%~dp0\\..\\..\\{zig_include_root} goto :set_zig_lib_dir :have_external_zig_sdk_lib -set ZIG_LIB_DIR=external\\zig_sdk\\lib +set ZIG_LIB_DIR=external\\zig_sdk\\{zig_include_root} :set_zig_lib_dir if exist "%TMP%\\*" goto :usertmp set ZIG_LOCAL_CACHE_DIR=C:\\Temp\\bazel-zig-cc @@ -187,7 +187,7 @@ def _zig_tool_wrapper(zig_tool, zig, is_windows, cache_prefix, zigtarget, zig_in cache_prefix = cache_prefix, maybe_gohack = _ZIG_TOOL_GOHACK if (zig_tool == "c++" and not is_windows) else "", maybe_target = "-target {}".format(zigtarget) if zig_tool == "c++" else "", - zig_include_root = zig_include_root, + zig_include_root = zig_include_root.replace("/", "\\") if is_windows else zig_include_root, ) if is_windows: