Skip to content

Commit

Permalink
Problem: missing universal library for mac arm64, x86_64 (fix #460) (#…
Browse files Browse the repository at this point in the history
…461)

Solution: add universal binary

fix typo
  • Loading branch information
leejw51crypto authored Aug 8, 2023
1 parent 05fddad commit a8aad34
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
## [Unreleased]

## [v0.0.23-alpha] - 2023-8-7
- add mac universal binary (arm64 + x86_64)

## [v0.0.22-alpha] - 2023-7-26
- fix Array in abi json encoding
## [v0.0.21-alpha] - 2023-6-12
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,27 @@ clone:
build_play-cpp-sdk: clone
ifeq ($(shell uname -m), x86_64)
ifeq ($(UNAME), Darwin)
ifeq ($(USE_ARM64),true)
cargo install cargo-lipo
rustup target add aarch64-apple-darwin
MACOSX_DEPLOYMENT_TARGET=10.15 CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release --target aarch64-apple-darwin
else
rustup target add x86_64-apple-darwin
MACOSX_DEPLOYMENT_TARGET=10.15 CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release
endif
MACOSX_DEPLOYMENT_TARGET=10.15 CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release --target aarch64-apple-darwin
MACOSX_DEPLOYMENT_TARGET=10.15 CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release
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
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
endif
ifeq ($(UNAME), Linux)
CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release
endif
else
ifeq ($(shell uname -m), arm64)
ifeq ($(UNAME), Darwin)
ifeq ($(USE_ARM64), true)
cargo install cargo-lipo
rustup target add aarch64-apple-darwin
MACOSX_DEPLOYMENT_TARGET=10.15 CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release
else
rustup target add x86_64-apple-darwin
MACOSX_DEPLOYMENT_TARGET=10.15 CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release
MACOSX_DEPLOYMENT_TARGET=10.15 CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release --target x86_64-apple-darwin
endif
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
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
endif
else
CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) cargo build --package play-cpp-sdk --release
Expand Down
2 changes: 1 addition & 1 deletion play-cpp-sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "play-cpp-sdk"
version = "0.0.22-alpha"
version = "0.0.23-alpha"
edition = "2021"
license = "Apache-2.0"

Expand Down

0 comments on commit a8aad34

Please sign in to comment.