Skip to content

Commit

Permalink
Merge pull request #12165 from deannagarcia/fixWindowsExe
Browse files Browse the repository at this point in the history
Condition executable name on build system
  • Loading branch information
deannagarcia authored Mar 7, 2023
2 parents b3733bf + 5476b46 commit b869151
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
8 changes: 8 additions & 0 deletions build_defs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ config_setting(
},
)

selects.config_setting_group(
name = "config_win",
match_any = [
":config_win32",
":config_win64",
]
)

config_setting(
name = "config_osx_aarch64",
values = {"cpu": "osx-aarch_64"},
Expand Down
14 changes: 13 additions & 1 deletion pkg/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,23 @@ genrule(
srcs = ["//:protoc_static"],
outs = ["bin/protoc"],
cmd = "cp $< $@",
tags = ["manual"],
)

genrule(
name = "rename_protoc_exe",
srcs = ["//:protoc_static"],
outs = ["bin/protoc.exe"],
cmd = "cp $< $@",
tags = ["manual"],
)

pkg_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"),
prefix = "bin/",
visibility = ["//visibility:private"],
Expand Down

0 comments on commit b869151

Please sign in to comment.