@@ -125,9 +125,12 @@ args = [
125
125
" -headers" , " ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/crates/core/c_src/include" ,
126
126
# Universal iOS sim
127
127
" -library" , " ${CARGO_TARGET_DIR}/universal-ios-sim-libliveview_native_core.a" ,
128
+ " -headers" , " ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/crates/core/c_src/include" ,
129
+ # Universal watchOS
130
+ " -library" , " ${CARGO_TARGET_DIR}/universal-watchos-libliveview_native_core.a" ,
128
131
" -headers" , " ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/crates/core/c_src/include" ,
129
132
]
130
- dependencies = [" build-macos" , " build-ios" , " lipo-macos" , " lipo-ios-sim" , " remove-existing-xcframework" ]
133
+ dependencies = [" build-macos" , " build-ios" , " build-watchos " , " lipo-macos" , " lipo-ios-sim" , " lipo-watchos " , " remove-existing-xcframework" ]
131
134
132
135
[tasks .remove-existing-xcframework ]
133
136
workspace = false
@@ -151,6 +154,14 @@ command = "rustup"
151
154
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" ]
152
155
dependencies = [" install-targets" ]
153
156
157
+ [tasks .build-watchos ]
158
+ workspace = false
159
+ category = " Build"
160
+ description = " Compiles for all targets needed to produce a universal library for watchOS"
161
+ command = " rustup"
162
+ 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" ]
163
+ dependencies = [" install-targets" ]
164
+
154
165
# different architectures for the same platform need to be lipo'd together before going into the xcframework
155
166
[tasks .lipo-macos ]
156
167
worksapce = false
@@ -180,6 +191,22 @@ args = [
180
191
" ${CARGO_TARGET_DIR}/x86_64-apple-ios/debug/libliveview_native_core.a" ,
181
192
]
182
193
194
+ [tasks .lipo-watchos ]
195
+ worksapce = false
196
+ category = " Packaging"
197
+ description = " Creates universal binary for watchOS Simulator"
198
+ command = " xcrun"
199
+ args = [
200
+ " lipo" ,
201
+ " -create" ,
202
+ " -output" ,
203
+ " ${CARGO_TARGET_DIR}/universal-watchos-libliveview_native_core.a" ,
204
+ " ${CARGO_TARGET_DIR}/arm64_32-apple-watchos/debug/libliveview_native_core.a" ,
205
+ " ${CARGO_TARGET_DIR}/armv7k-apple-watchos/debug/libliveview_native_core.a" ,
206
+ " ${CARGO_TARGET_DIR}/aarch64-apple-watchos-sim/debug/libliveview_native_core.a" ,
207
+ " ${CARGO_TARGET_DIR}/x86_64-apple-watchos-sim/debug/libliveview_native_core.a" ,
208
+ ]
209
+
183
210
[tasks .install-targets ]
184
211
workspace = false
185
212
private = true
0 commit comments