From 04b95526aeef10614bb33fe12b3adb9b533c6772 Mon Sep 17 00:00:00 2001 From: Fabian Hahn Date: Wed, 28 Sep 2022 19:58:17 +0100 Subject: [PATCH] fix Windows host support with relative paths --- toolchain/defs.bzl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/toolchain/defs.bzl b/toolchain/defs.bzl index 0aba0fb..284d2fe 100644 --- a/toolchain/defs.bzl +++ b/toolchain/defs.bzl @@ -93,15 +93,25 @@ _ZIG_TOOLS = [ "wasm-ld", # WebAssembly ] -# TODO: ZIG_LIB_DIR equivalent in powershell? _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 +goto :set_zig_lib_dir +:have_external_zig_sdk_lib +set ZIG_LIB_DIR=external\\zig_sdk\\lib +:set_zig_lib_dir set ZIG_LOCAL_CACHE_DIR={cache_prefix}\\bazel-zig-cc set ZIG_GLOBAL_CACHE_DIR=%ZIG_LOCAL_CACHE_DIR% "{zig}" "{zig_tool}" %* """ -# TODO: ZIG_LIB_DIR equivalent in powershell? _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 +goto :set_zig_lib_dir +:have_external_zig_sdk_lib +set ZIG_LIB_DIR=external\\zig_sdk\\lib +:set_zig_lib_dir if exist "%TMP%\\*" goto :usertmp set ZIG_LOCAL_CACHE_DIR=C:\\Temp\\bazel-zig-cc goto zig