Add '-Fsystem' framework search option to indicate path for frameworks that should be treated as 'system'

This has the effect of propagating the search path to the clang importer as '-iframework'.
It doesn't affect whether a swift module is treated as system or not, this can be done as follow-up enhancement.
This commit is contained in:
Argyrios Kyrtzidis
2017-02-14 16:07:02 -08:00
parent ff4b055935
commit ca906d1e99
28 changed files with 159 additions and 57 deletions

View File

@@ -996,8 +996,10 @@ ModuleFile::ModuleFile(
}
case input_block::SEARCH_PATH: {
bool isFramework;
input_block::SearchPathLayout::readRecord(scratch, isFramework);
SearchPaths.push_back({blobData, isFramework});
bool isSystem;
input_block::SearchPathLayout::readRecord(scratch, isFramework,
isSystem);
SearchPaths.push_back({blobData, isFramework, isSystem});
break;
}
default:
@@ -1187,8 +1189,9 @@ Status ModuleFile::associateWithFileContext(FileUnit *file,
return error(Status::TargetTooNew);
}
for (const auto &searchPathPair : SearchPaths)
ctx.addSearchPath(searchPathPair.first, searchPathPair.second);
for (const auto &searchPath : SearchPaths)
ctx.addSearchPath(searchPath.Path, searchPath.IsFramework,
searchPath.IsSystem);
auto clangImporter = static_cast<ClangImporter *>(ctx.getClangModuleLoader());