aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
diff options
context:
space:
mode:
authorEric Astor <epastor@google.com>2020-04-30 15:29:52 -0400
committerEric Astor <epastor@google.com>2020-04-30 15:30:56 -0400
commite9827f0b82751687f35d21d29f86adfab63a8dd5 (patch)
treedf42926005fa9fc37c0faaa3d0a98c6458b74647 /llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
parent9ecddde321c2231e4440396dfd9f1a4718d38ba8 (diff)
downloadllvm-e9827f0b82751687f35d21d29f86adfab63a8dd5.zip
llvm-e9827f0b82751687f35d21d29f86adfab63a8dd5.tar.gz
llvm-e9827f0b82751687f35d21d29f86adfab63a8dd5.tar.bz2
[ms] Add new option to llvm-lib: /llvmlibempty
Summary: Add a new option (/llvmlibempty). If passed and llvm-lib does not give an error, it will create a valid output archive even if empty. By default, llvm-lib mimicks lib.exe: if given no input files, it doesn't create its output file at all. This is incompatible with some build systems, so we add a command-line option to toggle this compatibility behavior. Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D78894
Diffstat (limited to 'llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp')
-rw-r--r--llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
index 3ea5312..69106bb 100644
--- a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
+++ b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
@@ -292,8 +292,9 @@ int llvm::libDriverMain(ArrayRef<const char *> ArgsArr) {
return 0;
}
- // If no input files, silently do nothing to match lib.exe.
- if (!Args.hasArgNoClaim(OPT_INPUT))
+ // If no input files and not told otherwise, silently do nothing to match
+ // lib.exe
+ if (!Args.hasArgNoClaim(OPT_INPUT) && !Args.hasArg(OPT_llvmlibempty))
return 0;
if (Args.hasArg(OPT_lst)) {