Skip to content

Fixed the issue where the file size could not be correctly obtained within the HarmonyOS Next sandbox. #8154

Fixed the issue where the file size could not be correctly obtained within the HarmonyOS Next sandbox.

Fixed the issue where the file size could not be correctly obtained within the HarmonyOS Next sandbox. #8154

name: <Native> Compile
on:
pull_request:
paths:
- 'templates/**'
- 'native/**'
- '.github/workflows/native-compile-platforms.yml'
# github.head_ref is only defined on pull_request events
concurrency:
group: ${{ github.workflow }}-${{ github.actor }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
compile_windows:
name: "Windows"
if:
(! contains(github.event.pull_request.body, '[X] does not change any runtime related code or build configuration'))
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
config:
- { buildtype: Debug }
- { buildtype: Release }
steps:
- uses: actions/checkout@v4
- name: Download external libraries
shell: bash
run: |
EXT_VERSION=`node ./.github/workflows/get-native-external-version.js`
git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos/cocos-engine-external native/external
- name: Install deps
uses: humbletim/setup-vulkan-sdk@523828e49cd4afabce369c39c7ee6543a2b7a735
with:
vulkan-query-version: 1.3.243.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: false
- name: Compile win64
shell: bash
env:
COCOS_ENGINE_DEV: 1
run: |
cd $GITHUB_WORKSPACE/templates/windows
echo "message(STATUS \"hook before \${CC_TARGET_NAME}\")" >> Pre-Sample.cmake
echo "message(STATUS \"hook after \${CC_TARGET_NAME}\")" >> Post-Sample.cmake
mkdir -p build-win64/proj
touch build-win64/proj/cfg.cmake
echo "set(USE_BOX2D_JSB ON)" >> build-win64/proj/cfg.cmake
echo "set(USE_PHYSICS_PHYSX ON)" >> build-win64/proj/cfg.cmake
echo "set(CC_USE_GLES3 ON)" >> build-win64/proj/cfg.cmake
echo "set(CC_USE_VULKAN ON)" >> build-win64/proj/cfg.cmake
echo "set(CC_USE_GLES2 ON)" >> build-win64/proj/cfg.cmake
echo "set(USE_WEBSOCKET_SERVER ON)" >> build-win64/proj/cfg.cmake
echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-win64/proj/cfg.cmake
echo "set(CC_EXECUTABLE_NAME \"\")" >> build-win64/proj/cfg.cmake
mkdir build-win64/assets
cd build-win64
RES_DIR=${GITHUB_WORKSPACE//\\//}/templates/windows/build-win64
COCOS_X_PATH=${GITHUB_WORKSPACE//\\//}/native
cmake ../ -G"Visual Studio 17 2022" -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$COCOS_X_PATH -Ax64
cmake --build . --config ${{ matrix.config.buildtype }}
echo "Compile Win64 ${{ matrix.config.buildtype }} Done!"
compile_android_minimal:
name: "Android Minimal"
if:
(! contains(github.event.pull_request.body, '[X] does not change any runtime related code or build configuration'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download external libraries
shell: bash
run: |
EXT_VERSION=`node ./.github/workflows/get-native-external-version.js`
git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos/cocos-engine-external native/external
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r28b
add-to-path: false
local-cache: true
- uses: actions/setup-java@v4
id: setup-jdk
with:
distribution: 'zulu'
java-version: '17'
- name: Compile
env:
COCOS_ENGINE_DEV: 1
run: |
NATIVE_ROOT=$GITHUB_WORKSPACE/native
ANDROID_NDK=${{ steps.setup-ndk.outputs.ndk-path }}
NDK_VERSION=${{ steps.setup-ndk.outputs.ndk-full-version }}
NATIVE_DIR=$GITHUB_WORKSPACE/templates/android-template
echo "Compiling Android ... "
cd $GITHUB_WORKSPACE/templates/
echo "message(STATUS \"hook before \${CC_TARGET_NAME}\")" >> android/template/Pre-Sample.cmake
echo "message(STATUS \"hook after \${CC_TARGET_NAME}\")" >> android/template/Post-Sample.cmake
if [ ! -d android-template ]; then
cp -r android/template android-template
fi
cd $GITHUB_WORKSPACE/templates/android/build
mkdir -p build-android/proj
touch build-android/proj/cfg.cmake
echo "set(CI_FORCE_MINIMAL_FEATURES ON)" >> build-android/proj/cfg.cmake
echo "set(COCOS_X_PATH $NATIVE_ROOT)" >> build-android/proj/cfg.cmake
echo "set(CC_EXECUTABLE_NAME \"\")" >> build-android/proj/cfg.cmake
mkdir -p build-android/proj/res/values
cat << EOF > build-android/proj/res/values/strings.xml
<resources>
<string name="app_name" translatable="false">CocosGame</string>
</resources>
EOF
mkdir -p build-android/assets
ASSET_DIR=$GITHUB_WORKSPACE/templates/android/build/build-android/
sed -i "s@^PROP_NDK_VERSION.*@PROP_NDK_VERSION=$NDK_VERSION@g" gradle.properties
sed -i "s@^APPLICATION_ID.*@APPLICATION_ID=com.cocos.android@g" gradle.properties
sed -i "s@^RES_PATH.*@RES_PATH=$ASSET_DIR@g" gradle.properties
sed -i "s@^COCOS_ENGINE_PATH.*@COCOS_ENGINE_PATH=$NATIVE_ROOT@g" gradle.properties
sed -i "s@^NATIVE_DIR.*@NATIVE_DIR=$NATIVE_DIR@g" gradle.properties
# To speedup CI, compile x86 only
# sed -i "s@^PROP_APP_ABI.*@PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86@g" gradle.properties
sed -i "s@^PROP_APP_ABI.*@PROP_APP_ABI=x86@g" gradle.properties
echo "Compile Android - cmake ..."
echo "ANDROID_NDK ${ANDROID_NDK} or ${ANDROID_NDK_HOME}"
# ./gradlew :CocosGame:assembleDebug --quiet
./gradlew :CocosGame:assembleRelease --quiet
echo "Compile Android Debug Done!"
compile_android:
name: "Android"
if:
(! contains(github.event.pull_request.body, '[X] does not change any runtime related code or build configuration'))
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- { arch: armeabi-v7a }
- { arch: arm64-v8a }
- { arch: x86 }
- { arch: x86_64 }
steps:
- name: Before free space
run: |
df -h
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@d5af243ce7bacb67384aa6c5b1fc5f169e30903e
with:
tool-cache: true
android: false
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: After free space
run: |
df -h
- uses: actions/checkout@v4
- name: Download external libraries
shell: bash
run: |
EXT_VERSION=`node ./.github/workflows/get-native-external-version.js`
git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos/cocos-engine-external native/external
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r28b
add-to-path: false
local-cache: true
- uses: actions/setup-java@v4
id: setup-jdk
with:
distribution: 'zulu'
java-version: '17'
- name: Compile
env:
COCOS_ENGINE_DEV: 1
run: |
NATIVE_ROOT=$GITHUB_WORKSPACE/native
ANDROID_NDK=${{ steps.setup-ndk.outputs.ndk-path }}
NDK_VERSION=${{ steps.setup-ndk.outputs.ndk-full-version }}
NATIVE_DIR=$GITHUB_WORKSPACE/templates/android-template
echo "Compiling Android ... "
cd $GITHUB_WORKSPACE/templates/
echo "message(STATUS \"hook before \${CC_TARGET_NAME}\")" >> android/template/Pre-Sample.cmake
echo "message(STATUS \"hook after \${CC_TARGET_NAME}\")" >> android/template/Post-Sample.cmake
if [ ! -d android-template ]; then
cp -r android/template android-template
fi
cd $GITHUB_WORKSPACE/templates/android/build
mkdir -p build-android/proj
touch build-android/proj/cfg.cmake
echo "set(USE_GOOGLE_BILLING ON)" >> build-android/proj/cfg.cmake
echo "set(USE_GOOGLE_PLAY_GAMES ON)" >> build-android/proj/cfg.cmake
echo "set(USE_PHYSICS_PHYSX ON)" >> build-android/proj/cfg.cmake
echo "set(CC_USE_GLES3 ON)" >> build-android/proj/cfg.cmake
echo "set(CC_USE_VULKAN ON)" >> build-android/proj/cfg.cmake
echo "set(CC_USE_GLES2 ON)" >> build-android/proj/cfg.cmake
echo "set(USE_BOX2D_JSB ON)" >> build-android/proj/cfg.cmake
echo "set(USE_WEBSOCKET_SERVER ON)" >> build-android/proj/cfg.cmake
echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-android/proj/cfg.cmake
echo "set(USE_SPINE_3_8 OFF)" >> build-android/proj/cfg.cmake
echo "set(USE_SPINE_4_2 ON)" >> build-android/proj/cfg.cmake
echo "set(COCOS_X_PATH $NATIVE_ROOT)" >> build-android/proj/cfg.cmake
echo "set(CC_EXECUTABLE_NAME \"\")" >> build-android/proj/cfg.cmake
mkdir -p build-android/proj/res/values
cat << EOF > build-android/proj/res/values/strings.xml
<resources>
<string name="app_name" translatable="false">CocosGame</string>
</resources>
EOF
mkdir -p build-android/assets
ASSET_DIR=$GITHUB_WORKSPACE/templates/android/build/build-android/
sed -i "s@^PROP_NDK_VERSION.*@PROP_NDK_VERSION=$NDK_VERSION@g" gradle.properties
sed -i "s@^APPLICATION_ID.*@APPLICATION_ID=com.cocos.android@g" gradle.properties
sed -i "s@^RES_PATH.*@RES_PATH=$ASSET_DIR@g" gradle.properties
sed -i "s@^COCOS_ENGINE_PATH.*@COCOS_ENGINE_PATH=$NATIVE_ROOT@g" gradle.properties
sed -i "s@^NATIVE_DIR.*@NATIVE_DIR=$NATIVE_DIR@g" gradle.properties
# To speedup CI, compile arm64-v8a only
# sed -i "s@^PROP_APP_ABI.*@PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86@g" gradle.properties
df -h
sed -i "s@^PROP_APP_ABI.*@PROP_APP_ABI=${{ matrix.config.arch }}@g" gradle.properties
echo "Compile Android - cmake ..."
echo "ANDROID_NDK ${ANDROID_NDK} or ${ANDROID_NDK_HOME}"
./gradlew :CocosGame:assembleDebug # --quiet
df -h
# ./gradlew clean
# sed -i "s@^PROP_APP_ABI.*@PROP_APP_ABI=armeabi-v7a@g" gradle.properties
# ./gradlew :CocosGame:assembleDebug --quiet
# df -h
echo "Compile Android Debug Done!"
compile_openharmony:
name: "Openharmony"
if:
(! contains(github.event.pull_request.body, '[X] does not change any runtime related code or build configuration'))
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- { arch: arm64-v8a, jsEngine: V8 }
- { arch: arm64-v8a, jsEngine: ARK }
- { arch: arm64-v8a, jsEngine: JSVM }
steps:
- name: Show PATH env
run: |
echo "PATH=$PATH"
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
echo "ldconfig"
ldconfig -v 2>/dev/null | awk '{print $1}' | grep -E '^/'
echo "/etc/ld.so.conf"
cat /etc/ld.so.conf
cat /etc/ld.so.conf.d/*
- name: Before free space
run: |
df -h
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@d5af243ce7bacb67384aa6c5b1fc5f169e30903e
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: After free space
run: |
df -h
- name: Install libgl1
run: |
sudo apt-get update
sudo apt-get install -y libgl1
- name: Checking libGL.so.1
run: |
echo "Checking libGL.so.1 since sdk/default/hms/toolchains/lib/libimage_transcoder_shared.so needs it"
ls -l /usr/lib/x86_64-linux-gnu/*.so*
- uses: actions/checkout@v4
- name: Download external libraries
shell: bash
run: |
EXT_VERSION=`node ./.github/workflows/get-native-external-version.js`
git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos/cocos-engine-external native/external
- uses: actions/setup-java@v4
id: setup-jdk
with:
distribution: 'zulu'
java-version: '17'
- name: Get oh sdk cache directory path
id: oh-sdk-cache-dir-path
run: |
echo "cache dir: "
echo "dir=$HOME/openharmony" >> $GITHUB_OUTPUT
- name: Output cache dir
run: |
echo "Output cache dir: ${{ steps.oh-sdk-cache-dir-path.outputs.dir }}"
- name: Cache OH SDK
id: cache-oh-sdk
uses: actions/cache@v4
env:
cache-name: cache-oh-sdk-21
with:
path: ${{ steps.oh-sdk-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-build-${{ env.cache-name }}
# - name: Add package.json
# run: |
# echo "{}" > package.json
# echo "{\"name\": \"tests\",\"lockfileVersion\": 3,\"requires\": true,\"packages\": {}}" > package-lock.json
- uses: actions/setup-node@v4
with:
node-version: 14
- if: ${{ steps.cache-oh-sdk.outputs.cache-hit != 'true' }}
name: No Cache found, install oh sdk
continue-on-error: false
run: |
if [ ! -d "$HOME/openharmony" ]; then
mkdir -p $HOME/openharmony
echo "Download commandline-tools-linux-x64-6.0.1.246.zip ..."
wget -q https://github.com/cocos/oh-sdk-for-ci/releases/download/api-21/commandline-tools-linux-x64-6.0.1.246.zip.001
wget -q https://github.com/cocos/oh-sdk-for-ci/releases/download/api-21/commandline-tools-linux-x64-6.0.1.246.zip.002
echo "Unzip commandline-tools-linux-x64-6.0.1.246.zip ..."
7z x commandline-tools-linux-x64-6.0.1.246.zip.001 -o$HOME/openharmony > /dev/null
cd $HOME/openharmony
ls -l
cd command-line-tools
ls -l
fi
- name: Compile for Openharmony
run: |
which node
which npm
which java
node -v
npm -v
java --version
echo "=============== list files in oh sdk ($HOME/openharmony) ==============="
pushd $HOME/openharmony/command-line-tools
ls -l
popd
export PATH=$PATH:$HOME/openharmony/command-line-tools/bin
echo "PATH=$PATH"
echo "hvigorw path:"
which hvigorw
echo "ohpm path:"
which ohpm
NATIVE_ROOT=$GITHUB_WORKSPACE/native
echo "Compiling Openharmony ... "
cd $GITHUB_WORKSPACE/templates/harmonyos-next
echo "message(STATUS \"hook before \${CC_TARGET_NAME}\")" >> Pre-Sample.cmake
echo "message(STATUS \"hook after \${CC_TARGET_NAME}\")" >> Post-Sample.cmake
mkdir -p build-oh/proj
touch build-oh/proj/cfg.cmake
echo "set(USE_PHYSICS_PHYSX ON)" >> build-oh/proj/cfg.cmake
echo "set(CC_USE_GLES3 ON)" >> build-oh/proj/cfg.cmake
echo "set(CC_USE_VULKAN OFF)" >> build-oh/proj/cfg.cmake
echo "set(CC_USE_GLES2 ON)" >> build-oh/proj/cfg.cmake
echo "set(USE_WEBSOCKET_SERVER OFF)" >> build-oh/proj/cfg.cmake
echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-oh/proj/cfg.cmake
echo "set(COCOS_X_PATH $NATIVE_ROOT)" >> build-oh/proj/cfg.cmake
echo "set(CC_EXECUTABLE_NAME \"\")" >> build-oh/proj/cfg.cmake
if [ "${{ matrix.config.jsEngine }}" = "V8" ]; then
echo "=============== JsEngine: V8 ==============="
echo "set(USE_SE_V8 ON)" >> build-oh/proj/cfg.cmake
echo "set(USE_SE_NAPI OFF)" >> build-oh/proj/cfg.cmake
echo "set(USE_SE_JSVM OFF)" >> build-oh/proj/cfg.cmake
elif [ "${{ matrix.config.jsEngine }}" = "JSVM" ]; then
echo "=============== JsEngine: JSVM ==============="
echo "set(USE_SE_V8 OFF)" >> build-oh/proj/cfg.cmake
echo "set(USE_SE_NAPI OFF)" >> build-oh/proj/cfg.cmake
echo "set(USE_SE_JSVM ON)" >> build-oh/proj/cfg.cmake
else
echo "=============== JsEngine: ARK ==============="
echo "set(USE_SE_V8 OFF)" >> build-oh/proj/cfg.cmake
echo "set(USE_SE_NAPI ON)" >> build-oh/proj/cfg.cmake
echo "set(USE_SE_JSVM OFF)" >> build-oh/proj/cfg.cmake
fi
echo "=============== cat build-oh/proj/cfg.cmake ==============="
cat build-oh/proj/cfg.cmake
mkdir -p build-oh/assets
ASSET_DIR=$GITHUB_WORKSPACE/templates/harmonyos-next/build-oh
echo "=============== HACK ./entry/build-profile.json5 ==============="
sed -i "s@[^-]DRES_DIR[^=]@$ASSET_DIR@g" ./entry/build-profile.json5
sed -i "s@[^-]DCOMMON_DIR[^=]@$GITHUB_WORKSPACE/templates/common@g" ./entry/build-profile.json5
# To speedup CI, compile arm64-v8a only
sed -i "s@arm64-v8a@${{ matrix.config.arch }}@g" ./entry/build-profile.json5
echo "entry/build-profile.json5: "
cat ./entry/build-profile.json5
# echo "=============== UPDATE ./hvigor/hvigor-config.json5 ==============="
# echo "{\"hvigorVersion\":\"3.0.2\",\"dependencies\":{\"@ohos/hvigor-ohos-plugin\":\"3.0.2\"}}" > ./hvigor/hvigor-config.json5
echo "=============== Do not import game.ts for cocos_worker.ets ==============="
sed -i '/<% if(!useV8) { %>/,/<% } %>/d' ./entry/src/main/ets/workers/cocos_worker.ets
sed -i '/<% if(useV8) { %>/,/<% } %>/d' ./entry/src/main/ets/workers/cocos_worker.ets
ls -l ./entry/src/main/ets/workers/cocos_worker.ets
echo "=============== EXECUTE hvigorw ==============="
ohpm install
hvigorw clean -i
hvigorw --stop-daemon -i
hvigorw --mode module -p product=default assembleHap --parallel --incremental debuggable=true --no-daemon -d
#./hvigorw default@ProcessLibs -p debuggable=true --no-daemon -d
echo "=============== EXECUTE hvigorw DONE ==============="
compile_mac:
name: "MacOS"
if:
(! contains(github.event.pull_request.body, '[X] does not change any runtime related code or build configuration'))
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
config:
- { arch: x86_64 }
- { arch: arm64 }
steps:
- uses: actions/checkout@v4
- name: Download external libraries
shell: bash
run: |
EXT_VERSION=`node ./.github/workflows/get-native-external-version.js`
git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos/cocos-engine-external native/external
- name: Compile
env:
COCOS_ENGINE_DEV: 1
run: |
NUM_OF_CORES=`getconf _NPROCESSORS_ONLN`
NATIVE_ROOT=$GITHUB_WORKSPACE/native
echo "Compiling MacOSX ... "
cd $GITHUB_WORKSPACE/templates/mac
echo "message(STATUS \"hook before \${CC_TARGET_NAME}\")" >> Pre-Sample.cmake
echo "message(STATUS \"hook after \${CC_TARGET_NAME}\")" >> Post-Sample.cmake
mkdir -p build-mac/proj
touch build-mac/proj/cfg.cmake
echo "set(USE_PHYSICS_PHYSX ON)" >> build-mac/proj/cfg.cmake
echo "set(CC_USE_VULKAN OFF)" >> build-mac/proj/cfg.cmake
echo "set(CC_USE_GLES2 OFF)" >> build-mac/proj/cfg.cmake
echo "set(CC_USE_GLES3 OFF)" >> build-mac/proj/cfg.cmake
echo "set(CC_USE_METAL ON)" >> build-mac/proj/cfg.cmake
# Test JSVM v8 backend on macOS.
echo "set(USE_SE_V8 OFF)" >> build-mac/proj/cfg.cmake
echo "set(USE_SE_JSVM ON)" >> build-mac/proj/cfg.cmake
echo "set(USE_WEBSOCKET_SERVER OFF)" >> build-mac/proj/cfg.cmake
echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-mac/proj/cfg.cmake
echo "set(CC_EXECUTABLE_NAME \"\")" >> build-mac/proj/cfg.cmake
mkdir build-mac/assets
RES_DIR=$GITHUB_WORKSPACE/templates/mac/build-mac
cd build-mac
cmake ../ -GXcode -DCMAKE_OSX_ARCHITECTURES=${{ matrix.config.arch }} -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$NATIVE_ROOT
set +e
cmake --build . --config Release -- -jobs $NUM_OF_CORES -arch ${{ matrix.config.arch }}
echo "Compile MacOSX Release Done!"
compile_iOS:
name: "iOS"
if:
(! contains(github.event.pull_request.body, '[X] does not change any runtime related code or build configuration'))
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
config:
- { sdk: iphoneos, arch: arm64 }
- { sdk: iphonesimulator, arch: x86_64 }
steps:
- uses: actions/checkout@v4
- name: Download external libraries
shell: bash
run: |
EXT_VERSION=`node ./.github/workflows/get-native-external-version.js`
git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos/cocos-engine-external native/external
- name: Compile
env:
COCOS_ENGINE_DEV: 1
run: |
set -x
NUM_OF_CORES=`getconf _NPROCESSORS_ONLN`
NATIVE_ROOT=$GITHUB_WORKSPACE/native
echo "Compiling iOS ... "
cd $GITHUB_WORKSPACE/templates/ios
echo "message(STATUS \"hook before \${CC_TARGET_NAME}\")" >> Pre-Sample.cmake
echo "message(STATUS \"hook after \${CC_TARGET_NAME}\")" >> Post-Sample.cmake
mkdir -p build-ios/proj
touch build-ios/proj/cfg.cmake
echo "set(USE_PHYSICS_PHYSX ON)" >> build-ios/proj/cfg.cmake
echo "set(CC_USE_GLES3 OFF)" >> build-ios/proj/cfg.cmake
echo "set(CC_USE_VULKAN OFF)" >> build-ios/proj/cfg.cmake
echo "set(CC_USE_GLES2 OFF)" >> build-ios/proj/cfg.cmake
echo "set(CC_USE_METAL ON)" >> build-ios/proj/cfg.cmake
echo "set(TARGET_IOS_VERSION 12.0)" >> build-ios/proj/cfg.cmake
echo "set(USE_WEBSOCKET_SERVER OFF)" >> build-ios/proj/cfg.cmake
echo "set(USE_DRAGONBONES OFF)" >> build-ios/proj/cfg.cmake
echo "set(CMAKE_CXX_STANDARD_REQUIRED OFF)" >> build-ios/proj/cfg.cmake
echo "set(MACOSX_BUNDLE_GUI_IDENTIFIER com.cocos.demo.ios)" >> build-ios/proj/cfg.cmake
echo "set(CC_EXECUTABLE_NAME \"\")" >> build-ios/proj/cfg.cmake
mkdir build-ios/assets
cd build-ios
RES_DIR=$GITHUB_WORKSPACE/templates/ios/build-ios
cmake ../ -GXcode -DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_OSX_SYSROOT=${{ matrix.config.sdk }} \
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.config.arch }} \
-DRES_DIR=$RES_DIR \
-DCOCOS_X_PATH=$NATIVE_ROOT
set +e
#cmake --build . --config Debug -- -quiet -jobs $NUM_OF_CORES -allowProvisioningUpdates CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
cmake --build . --config Debug -- -jobs $NUM_OF_CORES CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
echo "Compile iOS Done!"