Fix error in clang /MT equivalent flag patch.
authorAmy Huang <akhuang@google.com>
Thu, 15 Sep 2022 20:23:25 +0000 (20:23 +0000)
committerAmy Huang <akhuang@google.com>
Thu, 15 Sep 2022 20:24:51 +0000 (20:24 +0000)
This is a followup to reviews.llvm.org/D133457.

clang/lib/Driver/ToolChains/Clang.cpp

index 9737a0e..e215dc0 100644 (file)
@@ -6543,7 +6543,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   if (IsMSVCCompat)
     CmdArgs.push_back("-fms-compatibility");
 
-  if (Triple.isWindowsMSVCEnvironment() && !D.IsCLMode())
+  if (Triple.isWindowsMSVCEnvironment() && !D.IsCLMode() &&
+      Args.hasArg(options::OPT_fms_runtime_lib_EQ))
     ProcessVSRuntimeLibrary(Args, CmdArgs);
 
   // Handle -fgcc-version, if present.