-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathbuild-swift.sh
executable file
·44 lines (34 loc) · 1.33 KB
/
build-swift.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
set -e
THISDIR=$(dirname $0)
cd $THISDIR
#FLAGS=""
#MODE="debug"
FLAGS="--release"
MODE="release"
export SWIFT_BRIDGE_OUT_DIR="$(pwd)/crates/dt-swift/generated"
export RUSTFLAGS=""
# Build the project for the desired platforms:
cargo build $FLAGS --target x86_64-apple-darwin -p dt-swift
cargo build $FLAGS --target aarch64-apple-darwin -p dt-swift
mkdir -p ./target/universal-macos/"$MODE"
lipo \
./target/aarch64-apple-darwin/"$MODE"/libdt_swift.a \
./target/x86_64-apple-darwin/"$MODE"/libdt_swift.a \
-create -output ./target/universal-macos/"$MODE"/libdt_swift.a
cargo build $FLAGS --target aarch64-apple-ios -p dt-swift
#cargo build --target x86_64-apple-ios
cargo build $FLAGS --target aarch64-apple-ios-sim -p dt-swift
mkdir -p ./target/universal-ios/"$MODE"
#lipo \
# ./target/aarch64-apple-ios-sim/"$MODE"/libdt_swift.a \
# -create -output ./target/universal-ios/"$MODE"/libdt_swift.a
# ./target/aarch64-apple-ios/"$MODE"/libdt_swift.a \
swift-bridge-cli create-package \
--bridges-dir "$SWIFT_BRIDGE_OUT_DIR" \
--out-dir target/dt-swift \
--ios ./target/aarch64-apple-ios/"$MODE"/libdt_swift.a \
--simulator ./target/aarch64-apple-ios-sim/"$MODE"/libdt_swift.a \
--macos ./target/universal-macos/"$MODE"/libdt_swift.a \
--name DiamondTypes
#--simulator target/universal-ios/"$MODE"/libdt_swift.a \