Skip to content

Commit b869151

Browse files
authored
Merge pull request #12165 from deannagarcia/fixWindowsExe
Condition executable name on build system
2 parents b3733bf + 5476b46 commit b869151

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

build_defs/BUILD.bazel

+8
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ config_setting(
8484
},
8585
)
8686

87+
selects.config_setting_group(
88+
name = "config_win",
89+
match_any = [
90+
":config_win32",
91+
":config_win64",
92+
]
93+
)
94+
8795
config_setting(
8896
name = "config_osx_aarch64",
8997
values = {"cpu": "osx-aarch_64"},

pkg/BUILD.bazel

+13-1
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,23 @@ genrule(
6262
srcs = ["//:protoc_static"],
6363
outs = ["bin/protoc"],
6464
cmd = "cp $< $@",
65+
tags = ["manual"],
66+
)
67+
68+
genrule(
69+
name = "rename_protoc_exe",
70+
srcs = ["//:protoc_static"],
71+
outs = ["bin/protoc.exe"],
72+
cmd = "cp $< $@",
73+
tags = ["manual"],
6574
)
6675

6776
pkg_files(
6877
name = "protoc_files",
69-
srcs = ["bin/protoc"],
78+
srcs = select({
79+
"//build_defs:config_win": ["bin/protoc.exe"],
80+
"//conditions:default": ["bin/protoc"],
81+
}),
7082
attributes = pkg_attributes(mode = "0555"),
7183
prefix = "bin/",
7284
visibility = ["//visibility:private"],

0 commit comments

Comments
 (0)