From: Scott Bennett Date: Thu, 18 Mar 2021 20:42:51 +0000 (-0400) Subject: Add cmd_bat action to bazel export_spirv_headers target X-Git-Tag: upstream/11.4.0~23^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50dce096d986e9167c6623f86ced57304fdfeb0f;p=platform%2Fupstream%2Fglslang.git Add cmd_bat action to bazel export_spirv_headers target Only having `cmd` rather than separate `cmd_bash` and `cmd_bat` (or `cmd_ps`) requires bash to be installed on Windows. So adding support for `cmd_bat` makes glslangValidator easier to compile on Windows. --- diff --git a/BUILD.bazel b/BUILD.bazel index bfb7797..e8cf6a8 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -53,7 +53,8 @@ genrule( name = "gen_build_info_h", srcs = ["CHANGES.md", "build_info.h.tmpl"], outs = ["glslang/build_info.h"], - cmd = "$(location build_info) $$(dirname $(location CHANGES.md)) -i $(location build_info.h.tmpl) -o $(location glslang/build_info.h)", + cmd_bash = "$(location build_info) $$(dirname $(location CHANGES.md)) -i $(location build_info.h.tmpl) -o $(location glslang/build_info.h)", + cmd_bat = "for %F in ($(location CHANGES.md)) do $(location build_info) %~dpF -i $(location build_info.h.tmpl) -o $(location glslang/build_info.h)", tools = [":build_info"], ) @@ -143,7 +144,8 @@ genrule( "include/SPIRV/NonSemanticDebugPrintf.h", "include/SPIRV/spirv.hpp", ], - cmd = "mkdir -p $(@D)/include/SPIRV && cp $(SRCS) $(@D)/include/SPIRV/", + cmd_bash = "mkdir -p $(@D)/include/SPIRV && cp $(SRCS) $(@D)/include/SPIRV/", + cmd_bat = "(if not exist $(@D)\\include\\SPIRV mkdir $(@D)\\include\\SPIRV) && (for %S in ($(SRCS)) do @xcopy /q %S $(@D)\\include\\SPIRV\\ >NUL)", ) cc_library(