clang-cl: Hook up /Za to prevent adding oldnames.lib dependency
The /Za flag should probably do more, but let's start with this.
Differential Revision: http://llvm-reviews.chandlerc.com/D1320
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187991 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index fb27bfd..a1193f5 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -3719,10 +3719,11 @@
llvm_unreachable("Unexpected option ID.");
}
- // This provides POSIX compatibility (maps 'open' to '_open'), which most users
- // want. MSVC has a switch to turn off this autolinking, but it's not
- // implemented in clang yet.
- CmdArgs.push_back("--dependent-lib=oldnames");
+ if (!Args.hasArg(options::OPT__SLASH_Za)) {
+ // This provides POSIX compatibility (maps 'open' to '_open'),
+ // which most users want.
+ CmdArgs.push_back("--dependent-lib=oldnames");
+ }
}
void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,