diff --git a/protobuf.bzl b/protobuf.bzl index 2dc4ecdee3..c5b8dab385 100644 --- a/protobuf.bzl +++ b/protobuf.bzl @@ -477,10 +477,12 @@ def internal_copied_filegroup(name, srcs, strip_prefix, dest, **kwargs): name = name + "_genrule", srcs = srcs, outs = outs, - cmd = " && ".join( + cmd_bash = " && ".join( ["cp $(location %s) $(location %s)" % - (s, _RelativeOutputPath(s, strip_prefix, dest)) for s in srcs], - ), + (s, _RelativeOutputPath(s, strip_prefix, dest)) for s in srcs]), + cmd_bat = " && ".join( + ["@copy /Y $(location %s) $(location %s) >NUL" % + (s, _RelativeOutputPath(s, strip_prefix, dest)) for s in srcs]), ) native.filegroup( diff --git a/third_party/zlib.BUILD b/third_party/zlib.BUILD index 098f7bdd89..187bec2123 100644 --- a/third_party/zlib.BUILD +++ b/third_party/zlib.BUILD @@ -27,7 +27,11 @@ genrule( name = "copy_public_headers", srcs = _ZLIB_HEADERS, outs = _ZLIB_PREFIXED_HEADERS, - cmd = "cp $(SRCS) $(@D)/zlib/include/", + cmd_bash = "cp $(SRCS) $(@D)/zlib/include/", + cmd_bat = " && ".join( + ["@copy /Y $(location %s) $(@D)\\zlib\\include\\ >NUL" % + s for s in _ZLIB_HEADERS], + ), ) cc_library(