diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2010-10-20 07:00:47 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2010-10-20 07:00:47 +0000 |
commit | 24e17e175d15accc3f838846017f166a9c0a4c2f (patch) | |
tree | d248d60dc79121451920861775a125414f643bae /clang/lib/Driver/Tools.cpp | |
parent | a020a0159ff5d324c11a070e8db736a5eade541d (diff) | |
download | bcm5719-llvm-24e17e175d15accc3f838846017f166a9c0a4c2f.tar.gz bcm5719-llvm-24e17e175d15accc3f838846017f166a9c0a4c2f.zip |
Add support for the '--sysroot' flag, and an accompanying test of its
interactions with -isysroot and other driver commands.
llvm-svn: 116912
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 7924a034df8..882571fdb23 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -295,6 +295,15 @@ void Clang::AddPreprocessingOptions(const Driver &D, // -I- is a deprecated GCC feature, reject it. if (Arg *A = Args.getLastArg(options::OPT_I_)) D.Diag(clang::diag::err_drv_I_dash_not_supported) << A->getAsString(Args); + + // If we have a --sysroot, and don't have an explicit -isysroot flag, add an + // -isysroot to the CC1 invocation. + if (Arg *A = Args.getLastArg(options::OPT__sysroot_EQ)) { + if (!Args.hasArg(options::OPT_isysroot)) { + CmdArgs.push_back("-isysroot"); + CmdArgs.push_back(A->getValue(Args)); + } + } } /// getARMTargetCPU - Get the (LLVM) name of the ARM cpu we are targetting. |