Skip to content

Commit

Permalink
Problem: unable to instantiate module PlayCppSdkLibrary for mac (fix #…
Browse files Browse the repository at this point in the history
…336)

fix ios
0.0.15

restore

use universal library

remove legacy

update version 0.0.16
  • Loading branch information
leejw51crypto committed Aug 8, 2023
1 parent a43fab1 commit 7c10b6b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 91 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /usr/local/lib/android
mv ./Source/ThirdParty/PlayCppSdkLibrary/PlayCppSdkLibrary.Build.cs.legacy ./Source/ThirdParty/PlayCppSdkLibrary/PlayCppSdkLibrary.Build.cs
TARGET=4.27 make
python change_version.py 4.27.0
Expand Down Expand Up @@ -55,7 +54,6 @@ jobs:
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /usr/local/lib/android
mv ./Source/ThirdParty/PlayCppSdkLibrary/PlayCppSdkLibrary.Build.cs.legacy ./Source/ThirdParty/PlayCppSdkLibrary/PlayCppSdkLibrary.Build.cs
TARGET=5.1 make
python change_version.py 5.1.0
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:

- name: Prepare PlayCppSdk
run: |
mv ./Source/ThirdParty/PlayCppSdkLibrary/PlayCppSdkLibrary.Build.cs.legacy ./Source/ThirdParty/PlayCppSdkLibrary/PlayCppSdkLibrary.Build.cs
TARGET=4.27 make
python change_version.py 4.27.0
Expand Down Expand Up @@ -59,7 +58,6 @@ jobs:

- name: Prepare PlayCppSdk
run: |
mv ./Source/ThirdParty/PlayCppSdkLibrary/PlayCppSdkLibrary.Build.cs.legacy ./Source/ThirdParty/PlayCppSdkLibrary/PlayCppSdkLibrary.Build.cs
TARGET=5.0 make
python change_version.py 5.0.0
Expand Down Expand Up @@ -94,7 +92,6 @@ jobs:

- name: Prepare PlayCppSdk
run: |
mv ./Source/ThirdParty/PlayCppSdkLibrary/PlayCppSdkLibrary.Build.cs.legacy ./Source/ThirdParty/PlayCppSdkLibrary/PlayCppSdkLibrary.Build.cs
TARGET=5.1 make
python change_version.py 5.1.0
Expand Down Expand Up @@ -129,7 +126,6 @@ jobs:

- name: Prepare PlayCppSdk
run: |
rm ./Source/ThirdParty/PlayCppSdkLibrary/PlayCppSdkLibrary.Build.cs.legacy
TARGET=5.2 make
python change_version.py 5.2.0
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## [Unreleased]

## [v0.0.16-alpha] - 2023-8-8
- use universal library (x86_64 + arm64) for mac

## [v0.0.13-alpha] - 2023-6-15
- Support apple arm64
- Support Unreal Engine 5.2.0
Expand Down
2 changes: 1 addition & 1 deletion CronosPlayUnreal.uplugin
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"FileVersion": 3,
"FriendlyName": "Cronos Play for Unreal Engine",
"Version": 1,
"VersionName": "v0.0.13-alpha",
"VersionName": "v0.0.16-alpha",
"EngineVersion": "5.2.0",
"Description": "Cronos labs",
"Category": "Programming",
Expand Down
21 changes: 7 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ UNAME := $(shell uname)
PWD = $(shell pwd)

# Set the play cpp sdk version
PLAYCPPSDK=v0.0.21-alpha
PLAYCPPSDK=v0.0.23-alpha
# Set the play-cpp-sdk cache path
PLAYCPPSDK_CACHE_DIR=./install/$(PLAYCPPSDK)
# Set the play-cpp-sdk target path
Expand All @@ -29,7 +29,6 @@ ifndef NDK_VERSION
NDK_VERSION=25.1.8937393
endif
# Set names of play cpp sdk library files
MAC_FILE=play_cpp_sdk_Darwin_x86_64.tar.gz
MACARM64_FILE=play_cpp_sdk_Darwin_arm64.tar.gz
WINDOWS_FILE=play_cpp_sdk_Windows_x86_64.zip
LINUX_FILE=play_cpp_sdk_libc++_Linux_x86_64.tar.gz
Expand All @@ -47,8 +46,6 @@ ANDROID_ARMEABI_V7A_CHECKSUM_FILE=checksums-armv7-linux-androideabi-$(NDK_VERSIO
ANDROID_X86_64_CHECKSUM_FILE=checksums-x86_64-linux-android-$(NDK_VERSION).txt
IOS_CHECKSUM_FILE=checksums-aarch64-apple-ios.txt

MAC_SRC=https://github.com/cronos-labs/play-cpp-sdk/releases/download/$(PLAYCPPSDK)/$(MAC_FILE)
MAC_CHEKSUM_SRC=https://github.com/cronos-labs/play-cpp-sdk/releases/download/$(PLAYCPPSDK)/$(MAC_CHECKSUM_FILE)
MACARM64_SRC=https://github.com/cronos-labs/play-cpp-sdk/releases/download/$(PLAYCPPSDK)/$(MACARM64_FILE)
MACARM64_CHEKSUM_SRC=https://github.com/cronos-labs/play-cpp-sdk/releases/download/$(PLAYCPPSDK)/$(MACARM64_CHECKSUM_FILE)
WINDOWS_SRC=https://github.com/cronos-labs/play-cpp-sdk/releases/download/$(PLAYCPPSDK)/$(WINDOWS_FILE)
Expand All @@ -71,8 +68,8 @@ CACHE_OS_LIST := Mac/x86_64 Mac/arm64 Win64 Linux Android/arm64-v8a Android/arme
download:
for os in $(CACHE_OS_LIST); do \
if [ "$$os" = "Mac/x86_64" ]; then \
cache_file=$(MAC_FILE); \
cache_src=$(MAC_SRC); \
cache_file=$(MACARM64_FILE); \
cache_src=$(MACARM6_SRC); \
elif [ "$$os" = "Mac/arm64" ]; then \
cache_file=$(MACARM64_FILE); \
cache_src=$(MACARM64_SRC); \
Expand Down Expand Up @@ -107,7 +104,6 @@ download:

checkhash:
ifeq ($(UNAME), Darwin)
cd $(PLAYCPPSDK_CACHE_DIR)/Mac/x86_64 && curl -s -L $(MAC_CHEKSUM_SRC) | shasum -a 256 -c -
cd $(PLAYCPPSDK_CACHE_DIR)/Mac/arm64 && curl -s -L $(MACARM64_CHEKSUM_SRC) | shasum -a 256 -c -
cd $(PLAYCPPSDK_CACHE_DIR)/Win64 && curl -s -L $(WINDOWS_CHECKSUM_SRC) | shasum -a 256 -c -
cd $(PLAYCPPSDK_CACHE_DIR)/Linux && curl -s -L $(LINUX_CHECKSUM_SRC) | shasum -a 256 -c -
Expand All @@ -116,7 +112,6 @@ ifeq ($(UNAME), Darwin)
cd $(PLAYCPPSDK_CACHE_DIR)/Android/x86_64 && curl -s -L $(ANDROID_X86_64_CHECKSUM_SRC) | shasum -a 256 -c -
cd $(PLAYCPPSDK_CACHE_DIR)/iOS/arm64 && curl -s -L $(IOS_CHEKSUM_SRC) | shasum -a 256 -c -
else
cd $(PLAYCPPSDK_CACHE_DIR)/Mac/x86_64 && curl -s -L $(MAC_CHEKSUM_SRC) | sha256sum -c -
cd $(PLAYCPPSDK_CACHE_DIR)/Mac/arm64 && curl -s -L $(MACARM64_CHEKSUM_SRC) | sha256sum -c -
cd $(PLAYCPPSDK_CACHE_DIR)/Win64 && curl -s -L $(WINDOWS_CHECKSUM_SRC) | sha256sum -c -
cd $(PLAYCPPSDK_CACHE_DIR)/Linux && curl -s -L $(LINUX_CHECKSUM_SRC) | sha256sum -c -
Expand All @@ -127,24 +122,22 @@ else
endif

prepare:
mkdir -p $(PLAYCPPSDK_TARGET_DIR)/Mac/x86_64
mkdir -p $(PLAYCPPSDK_TARGET_DIR)/Mac/arm64
mkdir -p $(PLAYCPPSDK_TARGET_DIR)/Mac
mkdir -p $(PLAYCPPSDK_TARGET_DIR)/Win64
mkdir -p $(PLAYCPPSDK_TARGET_DIR)/Linux
mkdir -p $(PLAYCPPSDK_TARGET_DIR)/Android/arm64-v8a
mkdir -p $(PLAYCPPSDK_TARGET_DIR)/Android/armeabi-v7a
mkdir -p $(PLAYCPPSDK_TARGET_DIR)/Android/x86_64
mkdir -p $(PLAYCPPSDK_TARGET_DIR)/iOS/arm64
mkdir -p $(PLAYCPPSDK_TARGET_DIR)/iOS

uncompress: prepare
tar xvf $(PLAYCPPSDK_CACHE_DIR)/Mac/x86_64/$(MAC_FILE) -C $(PLAYCPPSDK_TARGET_DIR)/Mac/x86_64 --strip-components=2 sdk/lib/libplay_cpp_sdk.a
tar xvf $(PLAYCPPSDK_CACHE_DIR)/Mac/arm64/$(MACARM64_FILE) -C $(PLAYCPPSDK_TARGET_DIR)/Mac/arm64 --strip-components=2 sdk/lib/libplay_cpp_sdk.a
tar xvf $(PLAYCPPSDK_CACHE_DIR)/Mac/arm64/$(MACARM64_FILE) -C $(PLAYCPPSDK_TARGET_DIR)/Mac --strip-components=2 sdk/lib/libplay_cpp_sdk_universal.a && mv $(PLAYCPPSDK_TARGET_DIR)/Mac/libplay_cpp_sdk_universal.a $(PLAYCPPSDK_TARGET_DIR)/Mac/libplay_cpp_sdk.a
unzip -j $(PLAYCPPSDK_CACHE_DIR)/Win64/$(WINDOWS_FILE) sdk/lib/play_cpp_sdk.lib -d $(PLAYCPPSDK_TARGET_DIR)/Win64
tar xvf $(PLAYCPPSDK_CACHE_DIR)/Linux/$(LINUX_FILE) -C $(PLAYCPPSDK_TARGET_DIR)/Linux --strip-components=2 sdk/lib/libplay_cpp_sdk.a
tar xvf $(PLAYCPPSDK_CACHE_DIR)/Android/arm64-v8a/$(ARM64_V8A_FILE) -C $(PLAYCPPSDK_TARGET_DIR)/Android/arm64-v8a --strip-components=2 sdk/lib/libplay_cpp_sdk.a
tar xvf $(PLAYCPPSDK_CACHE_DIR)/Android/armeabi-v7a/$(ARMEABI_V7A_FILE) -C $(PLAYCPPSDK_TARGET_DIR)/Android/armeabi-v7a --strip-components=2 sdk/lib/libplay_cpp_sdk.a
tar xvf $(PLAYCPPSDK_CACHE_DIR)/Android/x86_64/$(X86_64_FILE) -C $(PLAYCPPSDK_TARGET_DIR)/Android/x86_64 --strip-components=2 sdk/lib/libplay_cpp_sdk.a
tar xvf $(PLAYCPPSDK_CACHE_DIR)/iOS/arm64/$(IOS_FILE) -C $(PLAYCPPSDK_TARGET_DIR)/iOS/arm64 --strip-components=2 sdk/lib/libplay_cpp_sdk.a
tar xvf $(PLAYCPPSDK_CACHE_DIR)/iOS/arm64/$(IOS_FILE) -C $(PLAYCPPSDK_TARGET_DIR)/iOS --strip-components=2 sdk/lib/libplay_cpp_sdk.a


# FIXME Build Android/IOS with RunUAT.sh
Expand Down
13 changes: 3 additions & 10 deletions Source/ThirdParty/PlayCppSdkLibrary/PlayCppSdkLibrary.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,8 @@ public PlayCppSdkLibrary(ReadOnlyTargetRules Target) : base(Target) {
PublicAdditionalLibraries.Add("ws2_32.lib");

} else if (Target.Platform == UnrealTargetPlatform.Mac) {
if (Target.Architecture == UnrealArch.X64)
PublicAdditionalLibraries.Add(Path.Combine(
LibrariesPath, "Mac/x86_64", "libplay_cpp_sdk.a"));
else if (Target.Architecture == UnrealArch.Arm64)
PublicAdditionalLibraries.Add(Path.Combine(
LibrariesPath, "Mac/arm64", "libplay_cpp_sdk.a"));
else {
throw new System.Exception("Unsupported architecture");
}
PublicAdditionalLibraries.Add(Path.Combine(
LibrariesPath, "Mac", "libplay_cpp_sdk.a"));
} else if (Target.Platform == UnrealTargetPlatform.Linux) {
PublicAdditionalLibraries.Add(
Path.Combine(LibrariesPath, "Linux", "libplay_cpp_sdk.a"));
Expand All @@ -61,7 +54,7 @@ public PlayCppSdkLibrary(ReadOnlyTargetRules Target) : base(Target) {
LibrariesPath, "Android", "x86_64", "libplay_cpp_sdk.a"));
} else if (Target.Platform == UnrealTargetPlatform.IOS) {
PublicAdditionalLibraries.Add(Path.Combine(
LibrariesPath, "iOS", "arm64", "libplay_cpp_sdk.a"));
LibrariesPath, "iOS", "libplay_cpp_sdk.a"));
}
}
}

This file was deleted.

0 comments on commit 7c10b6b

Please sign in to comment.