Merge pull request #78303 from ian-twilightcoder/clang-importer-search-paths

[ClangImporter] clang's -iframework comes before builtin usr/local/include, but Swift's -Fsystem comes after
This commit is contained in:
Ian Anderson
2025-01-06 13:05:25 -08:00
committed by GitHub
30 changed files with 257 additions and 143 deletions

View File

@@ -2475,7 +2475,7 @@ public:
if (!ResourceDir.empty()) {
InitInvoke.setRuntimeResourcePath(ResourceDir);
}
std::vector<SearchPathOptions::FrameworkSearchPath> FramePaths;
std::vector<SearchPathOptions::SearchPath> FramePaths;
for (const auto &path : CCSystemFrameworkPaths) {
FramePaths.push_back({path, /*isSystem=*/true});
}
@@ -2483,12 +2483,20 @@ public:
for (const auto &path : BaselineFrameworkPaths) {
FramePaths.push_back({path, /*isSystem=*/false});
}
InitInvoke.setImportSearchPaths(BaselineModuleInputPaths);
std::vector<SearchPathOptions::SearchPath> ImportPaths;
for (const auto &path : BaselineModuleInputPaths) {
ImportPaths.push_back({path, /*isSystem=*/false});
}
InitInvoke.setImportSearchPaths(ImportPaths);
} else {
for (const auto &path : FrameworkPaths) {
FramePaths.push_back({path, /*isSystem=*/false});
}
InitInvoke.setImportSearchPaths(ModuleInputPaths);
std::vector<SearchPathOptions::SearchPath> ImportPaths;
for (const auto &path : ModuleInputPaths) {
ImportPaths.push_back({path, /*isSystem=*/false});
}
InitInvoke.setImportSearchPaths(ImportPaths);
}
InitInvoke.setFrameworkSearchPaths(FramePaths);
if (!ModuleList.empty()) {