From 9568de0570c74f796a09b427f0fb71b060ad1354 Mon Sep 17 00:00:00 2001 From: Jiuqiang Tang Date: Sat, 1 Oct 2022 05:26:59 -0700 Subject: [PATCH] Remove "-Wno-unused-function" and "$(STACK_FRAME_UNLIMITED)" to resolve the "invalid numeric argument '/Wno-unused-function'" error on Windows. PiperOrigin-RevId: 478192521 --- third_party/stblib.BUILD | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/third_party/stblib.BUILD b/third_party/stblib.BUILD index 5169906cc..8a419d1f2 100644 --- a/third_party/stblib.BUILD +++ b/third_party/stblib.BUILD @@ -7,16 +7,19 @@ package( licenses(["notice"]) # MIT license -exports_files(["LICENSE"]) +COPTS = select({ + "@platforms//os:windows": [], + "//conditions:default": [ + "-Wno-unused-function", + "$(STACK_FRAME_UNLIMITED)", + ], +}) cc_library( name = "stb_image", srcs = ["stb_image.c"], hdrs = ["stb_image.h"], - copts = [ - "-Wno-unused-function", - "$(STACK_FRAME_UNLIMITED)", - ], + copts = COPTS, includes = ["."], ) @@ -24,5 +27,6 @@ cc_library( name = "stb_image_write", srcs = ["stb_image_write.c"], hdrs = ["stb_image_write.h"], + copts = COPTS, includes = ["."], )