Write FLUTTER_BUILD_MODE when using a local engine (#51687)
This commit is contained in:
@@ -209,9 +209,20 @@ List<String> _xcodeBuildSettingsLines({
|
||||
|
||||
if (globals.artifacts is LocalEngineArtifacts) {
|
||||
final LocalEngineArtifacts localEngineArtifacts = globals.artifacts as LocalEngineArtifacts;
|
||||
final String engineOutPath = localEngineArtifacts.engineOutPath;
|
||||
final String engineOutPath = globals.fs.path.basename(localEngineArtifacts.engineOutPath);
|
||||
String engineBuildMode = 'release';
|
||||
if (engineOutPath.toLowerCase().contains('debug')) {
|
||||
engineBuildMode = 'debug';
|
||||
} else if (engineOutPath.toLowerCase().contains('profile')) {
|
||||
engineBuildMode = 'profile';
|
||||
}
|
||||
xcodeBuildSettings.add('FLUTTER_ENGINE=${globals.fs.path.dirname(globals.fs.path.dirname(engineOutPath))}');
|
||||
xcodeBuildSettings.add('LOCAL_ENGINE=${globals.fs.path.basename(engineOutPath)}');
|
||||
xcodeBuildSettings.add('LOCAL_ENGINE=$engineOutPath');
|
||||
// Only write this or local engines, where it is supposed to be sticky to
|
||||
// match the engine configuration. Avoid writing it otherwise so that it
|
||||
// does not stick the user with the wrong build mode, particularly for
|
||||
// existing app use cases.
|
||||
xcodeBuildSettings.add('FLUTTER_BUILD_MODE=$engineBuildMode');
|
||||
|
||||
// Tell Xcode not to build universal binaries for local engines, which are
|
||||
// single-architecture.
|
||||
|
||||
Reference in New Issue
Block a user