Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool Generic_GCC::addGCCLibStdCxxIncludePaths(
- const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args,
- StringRef DebianMultiarch) const {
- assert(GCCInstallation.isValid());
- // By default, look for the C++ headers in an include directory adjacent to
- // the lib directory of the GCC installation. Note that this is expect to be
- // equivalent to '/usr/include/c++/X.Y' in almost all cases.
- StringRef LibDir = GCCInstallation.getParentLibPath();
- StringRef InstallDir = GCCInstallation.getInstallPath();
- StringRef TripleStr = GCCInstallation.getTriple().str();
- const Multilib &Multilib = GCCInstallation.getMultilib();
- const GCCVersion &Version = GCCInstallation.getVersion();
- // Try /../$triple/include/c++/$version then /../include/c++/$version.
- if (addLibStdCXXIncludePaths(
- LibDir.str() + "/../" + TripleStr + "/include/c++/" + Version.Text,
- TripleStr, Multilib.includeSuffix(), DriverArgs, CC1Args))
- return true;
- // Detect Debian g++-multiarch-incdir.diff.
- StringRef DebianMultiarch =
- GCCInstallation.getTriple().getArch() == llvm::Triple::x86
- ? "i386-linux-gnu"
- : TripleStr;
- if (addLibStdCXXIncludePaths(LibDir.str() + "/../include/c++/" + Version.Text,
- DebianMultiarch, Multilib.includeSuffix(),
- DriverArgs, CC1Args, /*Debian=*/true))
- return true;
- if (addLibStdCXXIncludePaths(LibDir.str() + "/../include/c++/" + Version.Text,
- TripleStr, Multilib.includeSuffix(),
- DriverArgs, CC1Args, /*Debian=*/true))
- return true;
- // Otherwise, fall back on a bunch of options which don't use multiarch
- // layouts for simplicity.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement