Skip to content

Commit a8aad34

Browse files
Problem: missing universal library for mac arm64, x86_64 (fix #460) (#461)
Solution: add universal binary fix typo
1 parent 05fddad commit a8aad34

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Changelog
22
## [Unreleased]
33

4+
## [v0.0.23-alpha] - 2023-8-7
5+
- add mac universal binary (arm64 + x86_64)
6+
47
## [v0.0.22-alpha] - 2023-7-26
58
- fix Array in abi json encoding
69
## [v0.0.21-alpha] - 2023-6-12

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,27 @@ clone:
5454
build_play-cpp-sdk: clone
5555
ifeq ($(shell uname -m), x86_64)
5656
ifeq ($(UNAME), Darwin)
57-
ifeq ($(USE_ARM64),true)
57+
cargo install cargo-lipo
5858
rustup target add aarch64-apple-darwin
59-
MACOSX_DEPLOYMENT_TARGET=10.15 CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release --target aarch64-apple-darwin
60-
else
6159
rustup target add x86_64-apple-darwin
62-
MACOSX_DEPLOYMENT_TARGET=10.15 CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release
63-
endif
60+
MACOSX_DEPLOYMENT_TARGET=10.15 CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release --target aarch64-apple-darwin
61+
MACOSX_DEPLOYMENT_TARGET=10.15 CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release
62+
lipo -create -output ./target/release/libplay_cpp_sdk_universal.a ./target/release/libplay_cpp_sdk.a ./target/aarch64-apple-darwin/release/libplay_cpp_sdk.a
63+
lipo -create -output ./target/aarch64-apple-darwin/release/libplay_cpp_sdk_universal.a ./target/release/libplay_cpp_sdk.a ./target/aarch64-apple-darwin/release/libplay_cpp_sdk.a
6464
endif
6565
ifeq ($(UNAME), Linux)
6666
CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release
6767
endif
6868
else
6969
ifeq ($(shell uname -m), arm64)
7070
ifeq ($(UNAME), Darwin)
71-
ifeq ($(USE_ARM64), true)
71+
cargo install cargo-lipo
7272
rustup target add aarch64-apple-darwin
73-
MACOSX_DEPLOYMENT_TARGET=10.15 CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release
74-
else
7573
rustup target add x86_64-apple-darwin
74+
MACOSX_DEPLOYMENT_TARGET=10.15 CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release
7675
MACOSX_DEPLOYMENT_TARGET=10.15 CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release --target x86_64-apple-darwin
77-
endif
76+
lipo -create -output ./target/release/libplay_cpp_sdk_universal.a ./target/release/libplay_cpp_sdk.a ./target/x86_64-apple-darwin/release/libplay_cpp_sdk.a
77+
lipo -create -output ./target/x86_64-apple-darwin/release/libplay_cpp_sdk_universal.a ./target/release/libplay_cpp_sdk.a ./target/x86_64-apple-darwin/release/libplay_cpp_sdk.a
7878
endif
7979
else
8080
CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release

play-cpp-sdk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "play-cpp-sdk"
3-
version = "0.0.22-alpha"
3+
version = "0.0.23-alpha"
44
edition = "2021"
55
license = "Apache-2.0"
66

0 commit comments

Comments
 (0)