Skip to content

Commit

Permalink
fix github action
Browse files Browse the repository at this point in the history
  • Loading branch information
whitecostume committed Nov 12, 2024
1 parent 014b3f4 commit ef603f8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,17 @@ jobs:
tar xvfz ohos-sdk-windows_linux-public.tar.gz
cd ohos-sdk/linux
unzip -o -d ./ native-linux-x64-4.1.7.5-Release.zip
- name: Build
- name: Build arm64
run: |
chmod +x build_ohos_arm64.sh
export OHOS_SDK=~/ohos-sdk/linux
./build_ohos_arm64.sh
- name: Build arm
run: |
chmod +x build_ohos_arm.sh
export OHOS_SDK=~/ohos-sdk/linux
./build_ohos_arm.sh
- name: Upload
uses: actions/upload-artifact@v4
with:
Expand Down
26 changes: 26 additions & 0 deletions build_ohos_arm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# OpenHarmony/ARM, armeabi-v7a
dynamic_cc=${OHOS_SDK}/native/llvm/bin/armv7-unknown-linux-ohos-clang
target_ld=${OHOS_SDK}/native/llvm/bin/armv7-unknown-linux-ohos-clang
static_cc=${dynamic_cc}
export target_ar="${OHOS_SDK}/native/llvm/bin/llvm-ar rcus 2>/dev/null"
target_strip=${OHOS_SDK}/native/llvm/bin/llvm-strip
cmake_tool=${OHOS_SDK}/native/build-tools/cmake/bin/cmake
toolchain_tool=${OHOS_SDK}/native/build/cmake/ohos.toolchain.cmake


cd luajit-2.1/src

make clean
make -j32 HOST_CC="gcc -m32" CFLAGS="-fPIC" DYNAMIC_CC=${dynamic_cc} TARGET_LD=${target_ld} STATIC_CC=${static_cc} TARGET_AR="${target_ar}" TARGET_STRIP=${target_strip}
cp ./libluajit.a ../../openharmony/libluajit.a
make clean

cd ../../openharmony
mkdir -p build # 创建一个构建目录
cd build
${cmake_tool} -DCMAKE_TOOLCHAIN_FILE=${toolchain_tool} -DOHOS_ARCH=armeabi-v7a .. -L
make -j32
ls
cd ..
mkdir -p ../Plugins/openharmony/libs/armeabi-v7a
cp build/libtolua.so ../Plugins/openharmony/libs/armeabi-v7a
4 changes: 3 additions & 1 deletion build_ohos_arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ target_ld=${OHOS_SDK}/native/llvm/bin/aarch64-unknown-linux-ohos-clang
static_cc=${dynamic_cc}
export target_ar="${OHOS_SDK}/native/llvm/bin/llvm-ar rcus 2>/dev/null"
target_strip=${OHOS_SDK}/native/llvm/bin/llvm-strip
cmake_tool=${OHOS_SDK}/native/build-tools/cmake/bin/cmake
toolchain_tool=${OHOS_SDK}/native/build/cmake/ohos.toolchain.cmake


cd luajit-2.1/src
Expand All @@ -16,7 +18,7 @@ make clean
cd ../../openharmony
mkdir -p build # 创建一个构建目录
cd build
${OHOS_SDK}/native/build-tools/cmake/bin/cmake -DCMAKE_TOOLCHAIN_FILE=${OHOS_SDK}/native/build/cmake/ohos.toolchain.cmake .. -L
${cmake_tool} -DCMAKE_TOOLCHAIN_FILE=${toolchain_tool} .. -L
make -j32
ls
cd ..
Expand Down

0 comments on commit ef603f8

Please sign in to comment.