Skip to content

Commit 7e194a8

Browse files
committed
Bundle CoreFoundation stub for macOS
1 parent b6c7685 commit 7e194a8

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ build_target_cross() {
5353

5454
mkdir -p "platform/targets/$target_name"
5555
cp "target/$rust_triple/release/libhost.a" "platform/targets/$target_name/"
56+
if [[ "$target_name" == *"mac"* ]]; then
57+
cp "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation.tbd" "platform/targets/$target_name/CoreFoundation.tbd"
58+
fi
5659
echo " -> platform/targets/$target_name/libhost.a"
5760
}
5861

@@ -73,11 +76,17 @@ build_target_native() {
7376
cargo build --release --lib --target "$rust_triple"
7477
mkdir -p "platform/targets/$target_name"
7578
cp "target/$rust_triple/release/libhost.a" "platform/targets/$target_name/"
79+
if [[ "$target_name" == *"mac"* ]]; then
80+
cp "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation.tbd" "platform/targets/$target_name/CoreFoundation.tbd"
81+
fi
7682
else
7783
# macOS: native is fine
7884
cargo build --release --lib
7985
mkdir -p "platform/targets/$target_name"
8086
cp "target/release/libhost.a" "platform/targets/$target_name/"
87+
if [[ "$target_name" == *"mac"* ]]; then
88+
cp "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation.tbd" "platform/targets/$target_name/CoreFoundation.tbd"
89+
fi
8190
fi
8291

8392
echo " -> platform/targets/$target_name/libhost.a"

bundle.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ roc_files=(*.roc)
99

1010
# Collect all host libraries and runtime files from targets directories
1111
lib_files=()
12-
for lib in targets/*/*.a targets/*/*.o; do
12+
for lib in targets/*/*.a targets/*/*.o targets/*/*.tbd; do
1313
if [[ -f "$lib" ]]; then
1414
lib_files+=("$lib")
1515
fi

platform/main.roc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ platform ""
66
targets: {
77
files: "targets/",
88
exe: {
9-
x64mac: ["libhost.a", "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation.tbd", app],
10-
arm64mac: ["libhost.a", "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation.tbd", app],
9+
x64mac: ["libhost.a", "CoreFoundation.tbd", app],
10+
arm64mac: ["libhost.a", "CoreFoundation.tbd", app],
1111
x64musl: ["crt1.o", "libhost.a", "libunwind.a", app, "libc.a"],
1212
arm64musl: ["crt1.o", "libhost.a", "libunwind.a", app, "libc.a"],
1313
}

0 commit comments

Comments
 (0)