================ @@ -2539,6 +2550,18 @@ void DarwinClang::AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs llvm::sys::path::append(P, "usr", "include"); addExternCSystemInclude(DriverArgs, CC1Args, P.str()); } + + // Add default framework search paths + auto addFrameworkInclude = [&](auto ...Path) { + SmallString<128> P(Sysroot); + llvm::sys::path::append(P, Path...); + + CC1Args.push_back("-internal-iframework"); + CC1Args.push_back(DriverArgs.MakeArgString(P)); + }; + addFrameworkInclude("System", "Library", "Frameworks"); ---------------- ldionne wrote:
I just tried refactoring into a static function and using the same for linker and headers, but there's a big mismatch between the two places we want to use the function from. Thus, we have to pass a ton of arguments to the newly-created `AddSearchPath` and they're not easy to derive (I still haven't figured out how to get the toolchain from `AddClangSystemIncludeArgs`). I do agree that using the same arguments as `AddSearchPath` is an improvement though, and that's easy to do. https://github.com/llvm/llvm-project/pull/120149 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits