aboutsummaryrefslogtreecommitdiffstats
path: root/runme.sh
diff options
context:
space:
mode:
Diffstat (limited to 'runme.sh')
-rwxr-xr-xrunme.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/runme.sh b/runme.sh
new file mode 100755
index 0000000..947d50a
--- /dev/null
+++ b/runme.sh
@@ -0,0 +1,34 @@
1#!/bin/bash
2
3##########################################################################
4# File Name : compile.sh
5# Encoding : utf-8
6# Author : We-unite
7# Email : weunite1848@gmail.com
8# Created Time : 2024-02-29 15:19:15
9##########################################################################
10
11set -e
12
13if [ $UID -eq 0 ]; then
14 echo "Please do not run this script as root"
15 exit 1
16fi
17
18if [ $# -ne 1 ]; then
19 echo "ERROR: $0 <arm64-v8a|x86_64>"
20 exit 1
21fi
22
23arch=$1
24link=static # or shared
25native_path=/home/player/app/native
26
27if [ $arch == "arm64-v8a" ]; then
28 export PATH=$native_path/build-tools/cmake/bin:$PATH
29 cmake -B build -D OHOS_STL=c++_$link -D OHOS_ARCH=$arch -D OHOS_PLATFORM=OHOS -D CMAKE_TOOLCHAIN_FILE=$(find $native_path -name ohos.toolchain.cmake)
30else
31 cmake -B build -D OHOS_ARCH=$arch
32fi
33
34cmake --build build