aboutsummaryrefslogtreecommitdiffhomepage
path: root/BUILD
diff options
context:
space:
mode:
authorGravatar Laszlo Csomor <laszlocsomor@google.com>2017-12-01 12:05:32 +0100
committerGravatar Laszlo Csomor <laszlocsomor@google.com>2018-05-22 08:57:57 +0200
commit5517168fa943e3696014b38a4e570bdf102383c7 (patch)
treeac807155e80c2a021ba40d4681a6d533f7de10c7 /BUILD
parentdd2dc0f14f9e5dc4e8343cc5f78d5f0bddd8991c (diff)
Windows: expand wildcard arguments
Diffstat (limited to 'BUILD')
-rw-r--r--BUILD14
1 files changed, 13 insertions, 1 deletions
diff --git a/BUILD b/BUILD
index d6fb85d8..6c625832 100644
--- a/BUILD
+++ b/BUILD
@@ -1,4 +1,4 @@
-# Bazel (http://bazel.io/) BUILD file for Protobuf.
+# Bazel (https://bazel.build/) BUILD file for Protobuf.
licenses(["notice"])
@@ -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"],
})