Use -miphonesimulator-version-min when building App.framework for simulator (#84729)
This commit is contained in:
@@ -29,6 +29,8 @@ const FakeCommand kARMCheckCommand = FakeCommand(
|
||||
|
||||
const List<String> kDefaultClang = <String>[
|
||||
'-miphoneos-version-min=8.0',
|
||||
'-isysroot',
|
||||
'path/to/sdk',
|
||||
'-dynamiclib',
|
||||
'-Xlinker',
|
||||
'-rpath',
|
||||
@@ -40,29 +42,6 @@ const List<String> kDefaultClang = <String>[
|
||||
'@loader_path/Frameworks',
|
||||
'-install_name',
|
||||
'@rpath/App.framework/App',
|
||||
'-isysroot',
|
||||
'path/to/sdk',
|
||||
'-o',
|
||||
'build/foo/App.framework/App',
|
||||
'build/foo/snapshot_assembly.o',
|
||||
];
|
||||
|
||||
const List<String> kBitcodeClang = <String>[
|
||||
'-miphoneos-version-min=8.0',
|
||||
'-dynamiclib',
|
||||
'-Xlinker',
|
||||
'-rpath',
|
||||
'-Xlinker',
|
||||
'@executable_path/Frameworks',
|
||||
'-Xlinker',
|
||||
'-rpath',
|
||||
'-Xlinker',
|
||||
'@loader_path/Frameworks',
|
||||
'-install_name',
|
||||
'@rpath/App.framework/App',
|
||||
'-fembed-bitcode',
|
||||
'-isysroot',
|
||||
'path/to/sdk',
|
||||
'-o',
|
||||
'build/foo/App.framework/App',
|
||||
'build/foo/snapshot_assembly.o',
|
||||
@@ -266,6 +245,7 @@ void main() {
|
||||
'cc',
|
||||
'-arch',
|
||||
'armv7',
|
||||
'-miphoneos-version-min=8.0',
|
||||
'-isysroot',
|
||||
'path/to/sdk',
|
||||
'-fembed-bitcode',
|
||||
@@ -279,7 +259,24 @@ void main() {
|
||||
'clang',
|
||||
'-arch',
|
||||
'armv7',
|
||||
...kBitcodeClang,
|
||||
'-miphoneos-version-min=8.0',
|
||||
'-isysroot',
|
||||
'path/to/sdk',
|
||||
'-dynamiclib',
|
||||
'-Xlinker',
|
||||
'-rpath',
|
||||
'-Xlinker',
|
||||
'@executable_path/Frameworks',
|
||||
'-Xlinker',
|
||||
'-rpath',
|
||||
'-Xlinker',
|
||||
'@loader_path/Frameworks',
|
||||
'-install_name',
|
||||
'@rpath/App.framework/App',
|
||||
'-fembed-bitcode',
|
||||
'-o',
|
||||
'build/foo/App.framework/App',
|
||||
'build/foo/snapshot_assembly.o',
|
||||
]),
|
||||
]);
|
||||
|
||||
@@ -328,6 +325,7 @@ void main() {
|
||||
'cc',
|
||||
'-arch',
|
||||
'armv7',
|
||||
'-miphoneos-version-min=8.0',
|
||||
'-isysroot',
|
||||
'path/to/sdk',
|
||||
'-c',
|
||||
@@ -387,6 +385,7 @@ void main() {
|
||||
'cc',
|
||||
'-arch',
|
||||
'armv7',
|
||||
'-miphoneos-version-min=8.0',
|
||||
'-isysroot',
|
||||
'path/to/sdk',
|
||||
'-c',
|
||||
@@ -419,7 +418,6 @@ void main() {
|
||||
expect(processManager, hasNoRemainingExpectations);
|
||||
});
|
||||
|
||||
|
||||
testWithoutContext('builds iOS armv7 snapshot', () async {
|
||||
final String outputPath = fileSystem.path.join('build', 'foo');
|
||||
final String genSnapshotPath = artifacts.getArtifactPath(
|
||||
@@ -445,6 +443,7 @@ void main() {
|
||||
'cc',
|
||||
'-arch',
|
||||
'armv7',
|
||||
'-miphoneos-version-min=8.0',
|
||||
'-isysroot',
|
||||
'path/to/sdk',
|
||||
'-c',
|
||||
@@ -500,6 +499,7 @@ void main() {
|
||||
'cc',
|
||||
'-arch',
|
||||
'arm64',
|
||||
'-miphoneos-version-min=8.0',
|
||||
'-isysroot',
|
||||
'path/to/sdk',
|
||||
'-c',
|
||||
|
||||
@@ -475,6 +475,7 @@ void main() {
|
||||
'cc',
|
||||
'-arch',
|
||||
'armv7',
|
||||
'-miphoneos-version-min=8.0',
|
||||
'-isysroot',
|
||||
'path/to/iPhoneOS.sdk',
|
||||
'-c',
|
||||
@@ -487,6 +488,7 @@ void main() {
|
||||
'cc',
|
||||
'-arch',
|
||||
'arm64',
|
||||
'-miphoneos-version-min=8.0',
|
||||
'-isysroot',
|
||||
'path/to/iPhoneOS.sdk',
|
||||
'-c',
|
||||
@@ -500,6 +502,8 @@ void main() {
|
||||
'-arch',
|
||||
'armv7',
|
||||
'-miphoneos-version-min=8.0',
|
||||
'-isysroot',
|
||||
'path/to/iPhoneOS.sdk',
|
||||
'-dynamiclib',
|
||||
'-Xlinker',
|
||||
'-rpath',
|
||||
@@ -511,8 +515,6 @@ void main() {
|
||||
'@loader_path/Frameworks',
|
||||
'-install_name',
|
||||
'@rpath/App.framework/App',
|
||||
'-isysroot',
|
||||
'path/to/iPhoneOS.sdk',
|
||||
'-o',
|
||||
'$build/armv7/App.framework/App',
|
||||
'$build/armv7/snapshot_assembly.o',
|
||||
@@ -523,6 +525,8 @@ void main() {
|
||||
'-arch',
|
||||
'arm64',
|
||||
'-miphoneos-version-min=8.0',
|
||||
'-isysroot',
|
||||
'path/to/iPhoneOS.sdk',
|
||||
'-dynamiclib',
|
||||
'-Xlinker',
|
||||
'-rpath',
|
||||
@@ -534,8 +538,6 @@ void main() {
|
||||
'@loader_path/Frameworks',
|
||||
'-install_name',
|
||||
'@rpath/App.framework/App',
|
||||
'-isysroot',
|
||||
'path/to/iPhoneOS.sdk',
|
||||
'-o',
|
||||
'$build/arm64/App.framework/App',
|
||||
'$build/arm64/snapshot_assembly.o',
|
||||
@@ -581,6 +583,7 @@ void main() {
|
||||
'cc',
|
||||
'-arch',
|
||||
'arm64',
|
||||
'-miphoneos-version-min=8.0',
|
||||
'-isysroot',
|
||||
'path/to/iPhoneOS.sdk',
|
||||
// Contains bitcode flag.
|
||||
@@ -596,6 +599,8 @@ void main() {
|
||||
'-arch',
|
||||
'arm64',
|
||||
'-miphoneos-version-min=8.0',
|
||||
'-isysroot',
|
||||
'path/to/iPhoneOS.sdk',
|
||||
'-dynamiclib',
|
||||
'-Xlinker',
|
||||
'-rpath',
|
||||
@@ -609,8 +614,6 @@ void main() {
|
||||
'@rpath/App.framework/App',
|
||||
// Contains bitcode flag.
|
||||
'-fembed-bitcode',
|
||||
'-isysroot',
|
||||
'path/to/iPhoneOS.sdk',
|
||||
'-o',
|
||||
'$build/arm64/App.framework/App',
|
||||
'$build/arm64/snapshot_assembly.o',
|
||||
@@ -656,6 +659,7 @@ void main() {
|
||||
'cc',
|
||||
'-arch',
|
||||
'arm64',
|
||||
'-miphoneos-version-min=8.0',
|
||||
'-isysroot',
|
||||
'path/to/iPhoneOS.sdk',
|
||||
// Contains bitcode flag.
|
||||
@@ -671,6 +675,8 @@ void main() {
|
||||
'-arch',
|
||||
'arm64',
|
||||
'-miphoneos-version-min=8.0',
|
||||
'-isysroot',
|
||||
'path/to/iPhoneOS.sdk',
|
||||
'-dynamiclib',
|
||||
'-Xlinker',
|
||||
'-rpath',
|
||||
@@ -684,8 +690,6 @@ void main() {
|
||||
'@rpath/App.framework/App',
|
||||
// Contains bitcode flag.
|
||||
'-fembed-bitcode',
|
||||
'-isysroot',
|
||||
'path/to/iPhoneOS.sdk',
|
||||
'-o',
|
||||
'$build/arm64/App.framework/App',
|
||||
'$build/arm64/snapshot_assembly.o',
|
||||
|
||||
@@ -35,7 +35,7 @@ const List<String> _kSharedConfig = <String>[
|
||||
'-install_name',
|
||||
'@rpath/App.framework/App',
|
||||
'-isysroot',
|
||||
'path/to/sdk',
|
||||
'path/to/iPhoneOS.sdk',
|
||||
];
|
||||
|
||||
void main() {
|
||||
@@ -69,9 +69,53 @@ void main() {
|
||||
expect(const AotAssemblyProfile().analyticsName, 'ios_aot');
|
||||
});
|
||||
|
||||
testUsingContext('DebugUniveralFramework creates simulator binary', () async {
|
||||
environment.defines[kIosArchs] = 'x86_64';
|
||||
environment.defines[kSdkRoot] = 'path/to/iPhoneSimulator.sdk';
|
||||
processManager.addCommand(
|
||||
FakeCommand(command: <String>[
|
||||
'xcrun',
|
||||
'clang',
|
||||
'-x',
|
||||
'c',
|
||||
'-arch',
|
||||
'x86_64',
|
||||
fileSystem.path.absolute(fileSystem.path.join(
|
||||
'.tmp_rand0', 'flutter_tools_stub_source.rand0', 'debug_app.cc')),
|
||||
'-dynamiclib',
|
||||
'-fembed-bitcode-marker',
|
||||
'-miphonesimulator-version-min=8.0',
|
||||
'-Xlinker',
|
||||
'-rpath',
|
||||
'-Xlinker',
|
||||
'@executable_path/Frameworks',
|
||||
'-Xlinker',
|
||||
'-rpath',
|
||||
'-Xlinker',
|
||||
'@loader_path/Frameworks',
|
||||
'-install_name',
|
||||
'@rpath/App.framework/App',
|
||||
'-isysroot',
|
||||
'path/to/iPhoneSimulator.sdk',
|
||||
'-o',
|
||||
environment.buildDir
|
||||
.childDirectory('App.framework')
|
||||
.childFile('App')
|
||||
.path,
|
||||
]),
|
||||
);
|
||||
|
||||
await const DebugUniversalFramework().build(environment);
|
||||
expect(processManager.hasRemainingExpectations, isFalse);
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fileSystem,
|
||||
ProcessManager: () => processManager,
|
||||
Platform: () => macPlatform,
|
||||
});
|
||||
|
||||
testUsingContext('DebugUniveralFramework creates expected binary with arm64 only arch', () async {
|
||||
environment.defines[kIosArchs] = 'arm64';
|
||||
environment.defines[kSdkRoot] = 'path/to/sdk';
|
||||
environment.defines[kSdkRoot] = 'path/to/iPhoneOS.sdk';
|
||||
processManager.addCommand(
|
||||
FakeCommand(command: <String>[
|
||||
'xcrun',
|
||||
|
||||
Reference in New Issue
Block a user