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
  • Loading branch information
leejw51crypto committed Aug 3, 2023
1 parent a43fab1 commit 98d7271
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 116 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
39 changes: 2 additions & 37 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 All @@ -49,40 +48,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Unreal_Release_5_0:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive

- 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
- name: Package For Windows,Mac
run: |
FILENAME="CronosPlayForUnrealEngine5.0.zip"
zip -r ${FILENAME} Source Resources CronosPlayUnreal.uplugin
sha256sum ${FILENAME} > "checksums.txt"
echo "release_file=${FILENAME}" >> $GITHUB_ENV
echo "checksum_file=checksums.txt" >> $GITHUB_ENV
- name: Upload binaries and bindings to Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
with:
draft: true
files: |
${{ env.release_file }}
${{ env.checksum_file }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Unreal_Release_5_1:
runs-on: ubuntu-latest
Expand All @@ -94,7 +59,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 All @@ -121,6 +85,8 @@ jobs:

Unreal_Release_5_2:
runs-on: ubuntu-latest
env:
USE_ARM64: true
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -129,7 +95,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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## [Unreleased]
use one binary for mac

## [v0.0.13-alpha] - 2023-6-15
- Support apple arm64
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.15-alpha",
"EngineVersion": "5.2.0",
"Description": "Cronos labs",
"Category": "Programming",
Expand Down
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,24 +127,26 @@ 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
ifeq ($(USE_ARM64), true)
tar xvf $(PLAYCPPSDK_CACHE_DIR)/Mac/arm64/$(MACARM64_FILE) -C $(PLAYCPPSDK_TARGET_DIR)/Mac --strip-components=2 sdk/lib/libplay_cpp_sdk.a
else
tar xvf $(PLAYCPPSDK_CACHE_DIR)/Mac/x86_64/$(MAC_FILE) -C $(PLAYCPPSDK_TARGET_DIR)/Mac --strip-components=2 sdk/lib/libplay_cpp_sdk.a
endif
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 98d7271

Please sign in to comment.