From abefa06ac75befdcdf119dc1e9a3ef2d0bdcf057 Mon Sep 17 00:00:00 2001 From: scribam Date: Mon, 27 Apr 2026 15:54:21 +0200 Subject: [PATCH] Fix Android build and add GitHub workflow --- .github/workflows/android.yml | 21 +++++++++++++++++++++ src/libchdr_chd.c | 6 ++++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..5f1bf99 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,21 @@ +name: Android + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + android_abi: [arm64-v8a, armeabi-v7a, x86, x86_64] + android_stl: [c++_shared, c++_static] + + steps: + - uses: actions/checkout@v6 + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \ + -DANDROID_ABI=${{ matrix.android_abi }} -DANDROID_STL=${{ matrix.android_stl }} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config Release diff --git a/src/libchdr_chd.c b/src/libchdr_chd.c index 1158f31..95dfeda 100644 --- a/src/libchdr_chd.c +++ b/src/libchdr_chd.c @@ -45,8 +45,10 @@ # ifndef _POSIX_C_SOURCE # define _POSIX_C_SOURCE 200809L # endif -# ifndef _FILE_OFFSET_BITS -# define _FILE_OFFSET_BITS 64 +# ifndef __ANDROID__ +# ifndef _FILE_OFFSET_BITS +# define _FILE_OFFSET_BITS 64 +# endif # endif #endif