mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ClangImporter] clang's -iframework comes before builtin usr/local/include, but Swift's -Fsystem comes after
When Swift passes search paths to clang, it does so directly into the HeaderSearch. That means that those paths get ordered inconsistently compared to the equivalent clang flag, and causes inconsistencies when building clang modules with clang and with Swift. Instead of touching the HeaderSearch directly, pass Swift search paths as driver flags, just do them after the -Xcc ones. Swift doesn't have a way to pass a search path to clang as -isystem, only as -I which usually isn't the right flag. Add an -Isystem Swift flag so that those paths can be passed to clang as -isystem. rdar://93951328
This commit is contained in:
@@ -99,7 +99,7 @@ std::optional<bool> forEachModuleSearchPath(
|
||||
callback) {
|
||||
for (const auto &path : Ctx.SearchPathOpts.getImportSearchPaths())
|
||||
if (auto result =
|
||||
callback(path, ModuleSearchPathKind::Import, /*isSystem=*/false))
|
||||
callback(path.Path, ModuleSearchPathKind::Import, path.IsSystem))
|
||||
return result;
|
||||
|
||||
for (const auto &path : Ctx.SearchPathOpts.getFrameworkSearchPaths())
|
||||
|
||||
Reference in New Issue
Block a user