Revert "Fall back to environment SDKROOT passed from Xcode (#52570)" (#52583)

This reverts commit 8e6e15f915.
This commit is contained in:
Jenn Magder
2020-03-13 18:29:09 -07:00
committed by GitHub
parent 8bff33e497
commit 73ea37eca9
5 changed files with 6 additions and 39 deletions

View File

@@ -225,7 +225,7 @@ class AOTSnapshotter {
final String assemblyO = globals.fs.path.join(outputPath, 'snapshot_assembly.o');
List<String> isysrootArgs;
if (isIOS) {
final String iPhoneSDKLocation = await globals.xcode.sdkLocation(SdkType.iPhone, globals.platform.environment);
final String iPhoneSDKLocation = await globals.xcode.sdkLocation(SdkType.iPhone);
if (iPhoneSDKLocation != null) {
isysrootArgs = <String>['-isysroot', iPhoneSDKLocation];
}

View File

@@ -412,7 +412,7 @@ Future<RunResult> createStubAppFramework(File outputFile, SdkType sdk, { bool in
'-Xlinker', '-rpath', '-Xlinker', '@executable_path/Frameworks',
'-Xlinker', '-rpath', '-Xlinker', '@loader_path/Frameworks',
'-install_name', '@rpath/App.framework/App',
'-isysroot', await globals.xcode.sdkLocation(sdk, globals.platform.environment),
'-isysroot', await globals.xcode.sdkLocation(sdk),
'-o', outputFile.path,
]);
} finally {

View File

@@ -165,17 +165,14 @@ class Xcode {
);
}
Future<String> sdkLocation(SdkType sdk, Map<String, String> environment) async {
// If this is run an Xcode script build phase, the SDKROOT is already exported.
if (environment.containsKey('SDKROOT')) {
return environment['SDKROOT'];
}
Future<String> sdkLocation(SdkType sdk) async {
assert(sdk != null);
final RunResult runResult = await _processUtils.run(
<String>['xcrun', '--sdk', getNameForSdk(sdk), '--show-sdk-path'],
throwOnError: true,
);
if (runResult.exitCode != 0) {
throwToolExit('Could not find SDK location: ${runResult.stderr}');
throwToolExit('Could not find iPhone SDK location: ${runResult.stderr}');
}
return runResult.stdout.trim();
}