Skip to content

Commit

Permalink
Make prebuilds for iOS and Android (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperisager authored Sep 12, 2024
1 parent 5a34014 commit 3defc51
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 5 deletions.
41 changes: 37 additions & 4 deletions .github/workflows/prebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,62 @@ jobs:
- os: ubuntu-22.04-arm64
platform: linux
arch: arm64
- os: ubuntu-22.04
platform: android
arch: x64
flags: --android-ndk 26.1.10909125 --android-api 34
- os: ubuntu-22.04
platform: android
arch: ia32
flags: --android-ndk 26.1.10909125 --android-api 34
- os: ubuntu-22.04
platform: android
arch: arm64
flags: --android-ndk 26.1.10909125 --android-api 34
- os: ubuntu-22.04
platform: android
arch: arm
flags: --android-ndk 26.1.10909125 --android-api 34
- os: macos-12
platform: darwin
arch: x64
- os: macos-14
platform: darwin
arch: arm64
- os: macos-14
platform: ios
arch: arm64
- os: macos-14
platform: ios
arch: arm64
tags: -simulator
flags: --simulator
- os: macos-14
platform: ios
arch: x64
tags: -simulator
flags: --simulator
- os: windows-2022
platform: win32
arch: x64
- os: windows-2022
platform: win32
arch: arm64
runs-on: ${{ matrix.os }}
name: ${{ matrix.platform }}-${{ matrix.arch }}
name: ${{ matrix.platform }}-${{ matrix.arch }}${{ matrix.tags }}
steps:
- run: sudo apt update && sudo apt install --yes build-essential
if: ${{ matrix.platform == 'linux' && matrix.arch == 'arm64' }}
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: npm install -g bare-dev
- run: npm install
- run: npm run prebuild
if: ${{ matrix.platform == 'linux' || matrix.platform == 'darwin' || matrix.platform == 'win32' }}
- run: bare-dev install --platform ${{ matrix.platform }} --arch ${{ matrix.arch }} ${{ matrix.flags }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-${{ matrix.arch }}
name: ${{ matrix.platform }}-${{ matrix.arch }}${{ matrix.tags }}
path: prebuilds/*
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ project(udx_native C)

include(bare)

bare_target(target)

if(NOT TARGET udx)
add_subdirectory(vendor/libudx EXCLUDE_FROM_ALL)
endif()
Expand All @@ -14,10 +16,20 @@ target_sources(
${udx_native}
PRIVATE
binding.c
PUBLIC
$<TARGET_OBJECTS:udx>
)

target_link_libraries(
${udx_native}
PUBLIC
udx_static
udx
)

if(target MATCHES "win32")
target_link_libraries(
${udx_native}
PUBLIC
ws2_32
)
endif()

0 comments on commit 3defc51

Please sign in to comment.