Skip to content

Commit

Permalink
Windows: check in the icon resource file
Browse files Browse the repository at this point in the history
The icon resource is a simple object file, built
by rc.exe, but rc.exe is part of the Windows Kit,
not of Visual Studio, and we have no reliable way
to locate it, so we can't reliably rebuild the
icon resource from source.

Rather than having a brittle genrule that may or
may not find the resource compiler, thus may or
may not successfully build the icon resource and
thus fail the whole build for //src:bazel.exe,
let's just use a prebuilt object file.

In a subsequent commit I'll add a script that can
rebuild this file.

Change-Id: Ia1f31ca9e78378088f93c9db144a2b708d690893
PiperOrigin-RevId: 163332738
  • Loading branch information
laszlocsomor authored and buchgr committed Jul 27, 2017
1 parent 7677e24 commit 92caf38
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 133 deletions.
4 changes: 2 additions & 2 deletions src/main/cpp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ cc_binary(
"global_variables.h",
"main.cc",
] + select({
"//src:windows": ["//src/main/native/windows:resources"],
"//src:windows_msvc": ["//src/main/native/windows:resources"],
"//src:windows": ["//src/main/native/windows:resources.o"],
"//src:windows_msvc": ["//src/main/native/windows:resources.o"],
"//conditions:default": [],
}),
copts = select({
Expand Down
23 changes: 5 additions & 18 deletions src/main/native/windows/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package(default_visibility = ["//visibility:private"])

exports_files(
["resources.o"],
visibility = ["//src/main/cpp:__pkg__"],
)

filegroup(
name = "srcs",
srcs = glob(["**"]),
Expand Down Expand Up @@ -48,21 +53,3 @@ genrule(
"//src/tools/android/java/com/google/devtools/build/android:__subpackages__",
],
)

genrule(
name = "resources",
srcs = ["//site:images/favicon.ico"],
outs = ["resources.o"],
cmd = " ".join([
"$(location compile-resources.sh)",
"$(location //site:images/favicon.ico)",
"$@",
"$(location gen_vsenv_stub.sh)",
]),
output_to_bindir = 1,
tools = [
"compile-resources.sh",
"gen_vsenv_stub.sh",
],
visibility = ["//src/main/cpp:__pkg__"],
)
46 changes: 0 additions & 46 deletions src/main/native/windows/compile-resources.sh

This file was deleted.

67 changes: 0 additions & 67 deletions src/main/native/windows/gen_vsenv_stub.sh

This file was deleted.

Binary file added src/main/native/windows/resources.o
Binary file not shown.

0 comments on commit 92caf38

Please sign in to comment.