Merge pull request #12165 from deannagarcia/fixWindowsExe

Condition executable name on build system
22.x-202303072154
deannagarcia 2 years ago committed by GitHub
commit b869151779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      build_defs/BUILD.bazel
  2. 14
      pkg/BUILD.bazel

@ -84,6 +84,14 @@ config_setting(
}, },
) )
selects.config_setting_group(
name = "config_win",
match_any = [
":config_win32",
":config_win64",
]
)
config_setting( config_setting(
name = "config_osx_aarch64", name = "config_osx_aarch64",
values = {"cpu": "osx-aarch_64"}, values = {"cpu": "osx-aarch_64"},

@ -62,11 +62,23 @@ genrule(
srcs = ["//:protoc_static"], srcs = ["//:protoc_static"],
outs = ["bin/protoc"], outs = ["bin/protoc"],
cmd = "cp $< $@", cmd = "cp $< $@",
tags = ["manual"],
)
genrule(
name = "rename_protoc_exe",
srcs = ["//:protoc_static"],
outs = ["bin/protoc.exe"],
cmd = "cp $< $@",
tags = ["manual"],
) )
pkg_files( pkg_files(
name = "protoc_files", name = "protoc_files",
srcs = ["bin/protoc"], srcs = select({
"//build_defs:config_win": ["bin/protoc.exe"],
"//conditions:default": ["bin/protoc"],
}),
attributes = pkg_attributes(mode = "0555"), attributes = pkg_attributes(mode = "0555"),
prefix = "bin/", prefix = "bin/",
visibility = ["//visibility:private"], visibility = ["//visibility:private"],

Loading…
Cancel
Save