diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-12-15 01:02:52 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-12-15 01:02:52 +0000 |
commit | 5f12232ef39e3d6c36d6600a73ebbe3c4a79f514 (patch) | |
tree | 1922b6f4081fdd660647d24c5724e6f3ba6746c1 /lib/Driver/Tools.cpp | |
parent | 41513444fe9d032dc74660c581d3689865bf32d3 (diff) |
Driver: Pass -resource-dir to clang -cc1, since the driver presumably already found itself.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91384 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 4279db59c9..70597ab913 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -9,6 +9,7 @@ #include "Tools.h" +#include "clang/Basic/Version.h" #include "clang/Driver/Action.h" #include "clang/Driver/Arg.h" #include "clang/Driver/ArgList.h" @@ -815,7 +816,16 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.AddLastArg(CmdArgs, options::OPT_nostdinc); Args.AddLastArg(CmdArgs, options::OPT_nobuiltininc); - Args.AddLastArg(CmdArgs, options::OPT_isysroot); + // Pass the path to compiler resource files. + // + // FIXME: Get this from a configuration object. + llvm::sys::Path P(D.Dir); + P.eraseComponent(); // Remove /bin from foo/bin + P.appendComponent("lib"); + P.appendComponent("clang"); + P.appendComponent(CLANG_VERSION_STRING); + CmdArgs.push_back("-resource-dir"); + CmdArgs.push_back(Args.MakeArgString(P.str())); // Add preprocessing options like -I, -D, etc. if we are using the // preprocessor. |