Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,12 @@ args = [
"-headers", "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/crates/core/c_src/include",
# Universal iOS sim
"-library", "${CARGO_TARGET_DIR}/universal-ios-sim-libliveview_native_core.a",
"-headers", "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/crates/core/c_src/include",
# Universal watchOS
"-library", "${CARGO_TARGET_DIR}/universal-watchos-libliveview_native_core.a",
"-headers", "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/crates/core/c_src/include",
]
dependencies = ["build-macos", "build-ios", "lipo-macos", "lipo-ios-sim", "remove-existing-xcframework"]
dependencies = ["build-macos", "build-ios", "build-watchos", "lipo-macos", "lipo-ios-sim", "lipo-watchos", "remove-existing-xcframework"]

[tasks.remove-existing-xcframework]
workspace = false
Expand All @@ -151,6 +154,14 @@ command = "rustup"
args = ["run", "${CARGO_MAKE_TOOLCHAIN}", "cargo", "build", "@@remove-empty(CARGO_MAKE_CARGO_VERBOSE_FLAGS)", "--target", "aarch64-apple-ios", "--target", "aarch64-apple-ios-sim", "--target", "x86_64-apple-ios", "-p", "liveview-native-core"]
dependencies = ["install-targets"]

[tasks.build-watchos]
workspace = false
category = "Build"
description = "Compiles for all targets needed to produce a universal library for watchOS"
command = "rustup"
args = ["run", "${CARGO_MAKE_TOOLCHAIN}", "cargo", "build", "@@remove-empty(CARGO_MAKE_CARGO_VERBOSE_FLAGS)", "-Z", "build-std", "--target", "arm64_32-apple-watchos", "--target", "armv7k-apple-watchos", "--target", "aarch64-apple-watchos-sim", "--target", "x86_64-apple-watchos-sim", "-p", "liveview-native-core"]
dependencies = ["install-targets"]

# different architectures for the same platform need to be lipo'd together before going into the xcframework
[tasks.lipo-macos]
worksapce = false
Expand Down Expand Up @@ -180,6 +191,22 @@ args = [
"${CARGO_TARGET_DIR}/x86_64-apple-ios/debug/libliveview_native_core.a",
]

[tasks.lipo-watchos]
worksapce = false
category = "Packaging"
description = "Creates universal binary for watchOS Simulator"
command = "xcrun"
args = [
"lipo",
"-create",
"-output",
"${CARGO_TARGET_DIR}/universal-watchos-libliveview_native_core.a",
"${CARGO_TARGET_DIR}/arm64_32-apple-watchos/debug/libliveview_native_core.a",
"${CARGO_TARGET_DIR}/armv7k-apple-watchos/debug/libliveview_native_core.a",
"${CARGO_TARGET_DIR}/aarch64-apple-watchos-sim/debug/libliveview_native_core.a",
"${CARGO_TARGET_DIR}/x86_64-apple-watchos-sim/debug/libliveview_native_core.a",
]

[tasks.install-targets]
workspace = false
private = true
Expand Down