From 77d4483fadbb1b7bcace18ed8e8e87e8791050f6 Mon Sep 17 00:00:00 2001 From: Mike Lundy Date: Fri, 1 Nov 2024 16:21:35 -0700 Subject: [PATCH] correct overeager slash conversion on windows (#1285) --- foreign_cc/private/cc_toolchain_util.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foreign_cc/private/cc_toolchain_util.bzl b/foreign_cc/private/cc_toolchain_util.bzl index 3b15578e..f0cef2e0 100644 --- a/foreign_cc/private/cc_toolchain_util.bzl +++ b/foreign_cc/private/cc_toolchain_util.bzl @@ -335,7 +335,7 @@ def _convert_flags(compiler, flags): list: The converted flags """ if compiler == "msvc-cl": - return [flag.replace("/", "-") if flag.startswith("/") else flag for flag in flags] + return [("-" + flag.removeprefix("/")) if flag.startswith("/") else flag for flag in flags] return flags def _add_if_needed(arr, add_arr):