Skip to content

Commit

Permalink
Windows: expand wildcard arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
laszlocsomor committed May 22, 2018
1 parent dd2dc0f commit 5517168
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Bazel (http://bazel.io/) BUILD file for Protobuf.
# Bazel (https://bazel.build/) BUILD file for Protobuf.

licenses(["notice"])

Expand Down Expand Up @@ -55,6 +55,18 @@ config_setting(
LINK_OPTS = select({
":android": [],
":msvc": [],
# Linking to setargv.obj makes the default command line argument
# parser expand wildcards, so the main method's argv will contain the
# expanded list instead of the wildcards.
# Using -WHOLEARCHIVE, because:
# - Microsoft ships this object file next to default libraries
# - but this file is not a library, just a precompiled object
# - just listing the name here without "-WHOLEARCHIVE:" would make Bazel
# believe that "setargv.obj" is a source or rule output in this
# package, which it is not.
# See https://msdn.microsoft.com/en-us/library/8bch7bkk.aspx
"-WHOLEARCHIVE:setargv.obj",
],
"//conditions:default": ["-lpthread", "-lm"],
})

Expand Down

0 comments on commit 5517168

Please sign in to comment.