From: Joerg Sonnenberger Date: Tue, 6 Dec 2016 16:40:57 +0000 (+0000) Subject: If clang was configured for a DEFAULT_SYSROOT and no --sysroot argument X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5da17811d817cd77171333f76bd501420a7880cd;p=clang If clang was configured for a DEFAULT_SYSROOT and no --sysroot argument 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 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index ac7309cf2a..ff46cbd893 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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();