blob: 947d50a5cd3d9420666d884ecd8645bd7808f1f8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#!/bin/bash
##########################################################################
# File Name : compile.sh
# Encoding : utf-8
# Author : We-unite
# Email : weunite1848@gmail.com
# Created Time : 2024-02-29 15:19:15
##########################################################################
set -e
if [ $UID -eq 0 ]; then
echo "Please do not run this script as root"
exit 1
fi
if [ $# -ne 1 ]; then
echo "ERROR: $0 <arm64-v8a|x86_64>"
exit 1
fi
arch=$1
link=static # or shared
native_path=/home/player/app/native
if [ $arch == "arm64-v8a" ]; then
export PATH=$native_path/build-tools/cmake/bin:$PATH
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)
else
cmake -B build -D OHOS_ARCH=$arch
fi
cmake --build build
|