mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Driver][Frontend] Add a -nostdlibimport argument
Add a -nostdlibimport (analagous to clang's -nostdlibinc) to remove the SDK paths from the import search paths, but leave the toolchain paths. rdar://139322299
This commit is contained in:
@@ -283,7 +283,7 @@ static void updateRuntimeLibraryPaths(SearchPathOptions &SearchPathOpts,
|
||||
RuntimeLibraryImportPaths.push_back(std::string(LibPath.str()));
|
||||
}
|
||||
|
||||
if (!SearchPathOpts.getSDKPath().empty()) {
|
||||
if (!SearchPathOpts.ExcludeSDKPathsFromRuntimeLibraryImportPaths && !SearchPathOpts.getSDKPath().empty()) {
|
||||
const char *swiftDir = FrontendOpts.UseSharedResourceFolder
|
||||
? "swift" : "swift_static";
|
||||
|
||||
@@ -2261,6 +2261,7 @@ static bool ParseSearchPathArgs(SearchPathOptions &Opts, ArgList &Args,
|
||||
Opts.RuntimeResourcePath = A->getValue();
|
||||
|
||||
Opts.SkipRuntimeLibraryImportPaths |= Args.hasArg(OPT_nostdimport);
|
||||
Opts.ExcludeSDKPathsFromRuntimeLibraryImportPaths |= Args.hasArg(OPT_nostdlibimport);
|
||||
|
||||
Opts.DisableModulesValidateSystemDependencies |=
|
||||
Args.hasArg(OPT_disable_modules_validate_system_headers);
|
||||
|
||||
Reference in New Issue
Block a user