From 50f778a8c39f0a43df7eca612b713edf48e527c8 Mon Sep 17 00:00:00 2001 From: FriwiDev Date: Tue, 16 Nov 2021 15:39:07 +0100 Subject: [PATCH] Add linux arm64 --- .github/workflows/build-linux-arm64.yml | 32 +++++++++++++++++++++++++ CMakeLists.txt | 4 +++- scripts/run_linux.sh | 8 +++---- 3 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/build-linux-arm64.yml diff --git a/.github/workflows/build-linux-arm64.yml b/.github/workflows/build-linux-arm64.yml new file mode 100644 index 0000000..3d0bd05 --- /dev/null +++ b/.github/workflows/build-linux-arm64.yml @@ -0,0 +1,32 @@ +name: build-linux-arm64 + +on: + workflow_dispatch: + inputs: + repo: + description: 'Git repository to clone' + required: true + default: 'https://bitbucket.org/chromiumembedded/java-cef.git' + ref: + description: 'Git commit id to checkout' + required: true + default: 'master' + +jobs: + build-linux-arm64: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up QEMU + uses: docker/setup-qemu-action@master + with: + platforms: all + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Build + run: | + chmod +x compile_linux.sh + ./compile_linux.sh arm64 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }} + diff --git a/CMakeLists.txt b/CMakeLists.txt index bf38bf1..6ef9006 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,8 +137,10 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") set(CEF_PLATFORM "macosx64") endif() elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") - if(CMAKE_SIZEOF_VOID_P MATCHES 8) + if("${PROJECT_ARCH}" STREQUAL "amd64") set(CEF_PLATFORM "linux64") + elseif("${PROJECT_ARCH}" STREQUAL "arm64") + set(CEF_PLATFORM "linuxarm64") else() set(CEF_PLATFORM "linux32") endif() diff --git a/scripts/run_linux.sh b/scripts/run_linux.sh index e40ba2e..4a884ab 100644 --- a/scripts/run_linux.sh +++ b/scripts/run_linux.sh @@ -21,14 +21,14 @@ fi mkdir jcef_build && cd jcef_build # Linux: Generate 32/64-bit Unix Makefiles. -cmake -G "Ninja" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. +cmake -G "Ninja" -DPROJECT_ARCH=${TARGETARCH} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. # Build native part using ninja. ninja -j4 #Compile JCEF java classes cd ../tools chmod +x compile.sh -if [ ${TARGETARCH} == 'amd64' ]; then +if [ ${TARGETARCH} == 'amd64' ] || [ ${TARGETARCH} == 'arm64' ]; then ./compile.sh linux64 else ./compile.sh linux32 @@ -36,14 +36,14 @@ fi #Generate distribution chmod +x make_distrib.sh -if [ ${TARGETARCH} == 'amd64' ]; then +if [ ${TARGETARCH} == 'amd64' ] || [ ${TARGETARCH} == 'arm64' ]; then ./make_distrib.sh linux64 else ./make_distrib.sh linux32 fi #Pack binary_distrib -if [ ${TARGETARCH} == 'amd64' ]; then +if [ ${TARGETARCH} == 'amd64' ] || [ ${TARGETARCH} == 'arm64' ]; then cd ../binary_distrib/linux64 if [ ${BUILD_TYPE} == 'Release' ]; then (echo "Stripping binary..." && strip bin/lib/linux64/libcef.so) fi else