]> granicus.if.org Git - clang/commitdiff
If clang was configured for a DEFAULT_SYSROOT and no --sysroot argument
authorJoerg Sonnenberger <joerg@bec.de>
Tue, 6 Dec 2016 16:40:57 +0000 (16:40 +0000)
committerJoerg Sonnenberger <joerg@bec.de>
Tue, 6 Dec 2016 16:40:57 +0000 (16:40 +0000)
is seen, record one with the implicit default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288822 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index ac7309cf2a707efcdb3b7873d44fa485086c32b8..ff46cbd893d5280c1d1d988922ad843dc132a4d3 100644 (file)
@@ -4061,6 +4061,11 @@ void Clang::DumpCompilationDatabase(Compilation &C, StringRef Filename,
   Buf = "-x";
   Buf += types::getTypeName(Input.getType());
   CDB << ", \"" << escape(Buf) << "\"";
+  if (!D.SysRoot.empty() && !Args.hasArg(options::OPT__sysroot_EQ)) {
+    Buf = "--sysroot=";
+    Buf += D.SysRoot;
+    CDB << ", \"" << escape(Buf) << "\"";
+  }
   CDB << ", \"" << escape(Input.getFilename()) << "\"";
   for (auto &A: Args) {
     auto &O = A->getOption();