-
Notifications
You must be signed in to change notification settings - Fork 718
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
336bb84
commit 417068a
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
if [ -n "$ANDROID_NDK" ]; then | ||
export NDK=${ANDROID_NDK} | ||
elif [ -n "$ANDROID_NDK_HOME" ]; then | ||
export NDK=${ANDROID_NDK_HOME} | ||
else | ||
export NDK=~/android-ndk-r21b | ||
fi | ||
|
||
if [ ! -d "$NDK" ]; then | ||
echo "Please set ANDROID_NDK environment to the root of NDK." | ||
exit 1 | ||
fi | ||
|
||
function build() { | ||
API=$1 | ||
ABI=$2 | ||
TOOLCHAIN_ANME=$3 | ||
BUILD_PATH=build.qjs.Android.${ABI} | ||
cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DJS_ENGINE=quickjs -DANDROID_ABI=${ABI} -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -H. -B${BUILD_PATH} -DCMAKE_TOOLCHAIN_FILE=${NDK}/build/cmake/android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=${API} -DANDROID_TOOLCHAIN=clang -DANDROID_TOOLCHAIN_NAME=${TOOLCHAIN_ANME} | ||
cmake --build ${BUILD_PATH} --config Release | ||
mkdir -p ../Assets/Plugins/Android/libs/${ABI}/ | ||
cp ${BUILD_PATH}/libpuerts.so ../Assets/Plugins/Android/libs/${ABI}/libpuerts.so | ||
} | ||
|
||
build android-18 armeabi-v7a arm-linux-androideabi-4.9 | ||
build android-18 arm64-v8a arm-linux-androideabi-clang |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
mkdir -p build_ios_qjs && cd build_ios_qjs | ||
cmake -DJS_ENGINE=quickjs -DCMAKE_TOOLCHAIN_FILE=../cmake/ios.toolchain.cmake -DPLATFORM=OS64 -GXcode ../ | ||
cd .. | ||
cmake --build build_ios_qjs --config Release | ||
mkdir -p ../Assets/Plugins/iOS/ | ||
cp build_ios_qjs/Release-iphoneos/libpuerts.a ../Assets/Plugins/iOS/ | ||
cp quickjs/Lib/iOS/arm64/*.a ../Assets/Plugins/iOS/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
mkdir -p build_osx_qjs && cd build_osx_qjs | ||
cmake -DJS_ENGINE=quickjs -GXcode ../ | ||
cd .. | ||
cmake --build build_osx_qjs --config Release | ||
mkdir -p ../Assets/Plugins/ | ||
cp -r build_osx_qjs/Release/puerts.bundle ../Assets/Plugins/ | ||
|