Skip to content

Commit

Permalink
Build x64-tvsimulator
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Nov 14, 2023
1 parent 75f06e2 commit fa82356
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
18 changes: 14 additions & 4 deletions scripts/build-skia-ios-framework.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable max-len */
import { configurations } from "./skia-configuration";
import { executeCmdSync, checkFileExists } from "./utils";
import { executeCmdSync, checkFileExists, ensureFolderExists } from "./utils";

/**
* This build script takes the prebuilt Skia Binaries and creates
Expand Down Expand Up @@ -41,11 +41,21 @@ console.log("");
console.log("Prerequisites met. Starting build.");
console.log("");

console.log("Building fat binary for iphone simulator");
console.log("Building fat binary for iphone / tv simulator");
configurations.ios.outputNames.forEach((out) => {
console.log(`Building fat binary for simulator for file ${out}`);
executeCmdSync(
`lipo -create package/libs/ios/x64/${out} package/libs/ios/arm64-iphonesimulator/${out} -output package/libs/ios/${
`lipo -create package/libs/ios/x64-iphonesimulator/${out} package/libs/ios/arm64-iphonesimulator/${out} -output package/libs/ios/${
out.split(".")[0]
}.a`
);
});

ensureFolderExists("package/libs/ios/tvsimulator")
configurations.tvos.outputNames.forEach((out) => {
console.log(`Building fat binary for simulator for file ${out}`);
executeCmdSync(
`lipo -create package/libs/ios/x64-tvsimulator/${out} package/libs/ios/arm64-tvsimulator/${out} -output package/libs/ios/tvsimulator/${
out.split(".")[0]
}.a`
);
Expand All @@ -62,7 +72,7 @@ configurations.ios.outputNames.forEach((out) => {
"xcodebuild -create-xcframework " +
`-library ./package/libs/ios/${libName}.a ` +
`-library ./package/libs/ios/arm64-iphoneos/${libName}.a ` +
`-library ./package/libs/ios/arm64-tvsimulator/${libName}.a ` +
`-library ./package/libs/ios/tvsimulator/${libName}.a ` +
`-library ./package/libs/ios/arm64-tvos/${libName}.a ` +
` -output ./package/libs/ios/${libName}.xcframework `
);
Expand Down
11 changes: 10 additions & 1 deletion scripts/skia-configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const configurations: Configuration = {
["extra_ldflags", '["-target", "arm64-apple-ios-simulator"]'],
],
},
x64: {
"x64-iphonesimulator": {
cpu: "x64",
args: [
["ios_min_target", '"13.0"'],
Expand Down Expand Up @@ -175,6 +175,15 @@ export const configurations: Configuration = {
["extra_ldflags", '["-target", "arm64-apple-tvos-simulator", "-mappletvos-version-min=13.0"]'],
],
},
"x64-tvsimulator": {
cpu: "x64",
args: [
["ios_use_simulator", "true"],
["extra_cflags", '["-target", "x86_64-apple-tvos-simulator", "-mappletvos-version-min=13.0"]'],
["extra_asmflags", '["-target", "x86_64-apple-tvos-simulator", "-mappletvos-version-min=13.0"]'],
["extra_ldflags", '["-target", "x86_64-apple-tvos-simulator", "-mappletvos-version-min=13.0"]'],
],
},
},
args: [
["skia_use_metal", true],
Expand Down

0 comments on commit fa82356

Please sign in to comment.