Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ARM32 Linux #62

Merged
merged 2 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .github/workflows/build-libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
- os: ubuntu-latest
arch: arm64
lib: libarm64/libFosterPlatform.so
- os: ubuntu-latest
arch: arm32
lib: libarm/libFosterPlatform.so
runs-on: ${{matrix.os}}
steps:
- name: Checkout
Expand All @@ -51,12 +54,26 @@ jobs:
sudo dpkg --add-architecture arm64
sudo apt-get update
sudo apt-get install -y libsdl2-dev:arm64 libwayland-dev:arm64 libegl-dev:arm64 libdrm-dev:arm64 libxkbcommon-dev:arm64 libpulse-dev:arm64
- name: Setup Linux dependencies (arm32)
if: ${{ runner.os == 'Linux' && matrix.arch == 'arm32' }}
run: |
sudo apt-get update
sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf
sudo sed -i "s/^deb/deb [arch=amd64,i386]/g" /etc/apt/sources.list
echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ $(lsb_release -s -c) main universe multiverse restricted" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ $(lsb_release -s -c)-updates main universe multiverse restricted" | sudo tee -a /etc/apt/sources.list
sudo dpkg --add-architecture armhf
sudo apt-get update
sudo apt-get install -y libsdl2-dev:armhf libwayland-dev:armhf libegl-dev:armhf libdrm-dev:armhf libxkbcommon-dev:armhf libpulse-dev:armhf
- name: CMake Configure
if: ${{ matrix.arch != 'arm64' }}
if: ${{ matrix.arch != 'arm64' && matrix.arch != 'arm32' }}
run: cmake -B build -S Platform
- name: CMake Configure (arm64)
if: ${{ runner.os == 'Linux' && matrix.arch == 'arm64' }}
run: PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig cmake -B build -S Platform -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_SYSTEM_NAME=Linux
- name: CMake Configure (arm32)
if: ${{ runner.os == 'Linux' && matrix.arch == 'arm32' }}
run: PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig cmake -B build -S Platform -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ -DCMAKE_SYSTEM_PROCESSOR=armv7l -DCMAKE_SYSTEM_NAME=Linux
- name: CMake Build
run: cmake --build build --config Release
- name: Publish Artifact
Expand Down Expand Up @@ -91,6 +108,11 @@ jobs:
with:
name: ubuntu-latest-arm64-build
path: Platform/libs/libarm64
- name: Download ubuntu lib (arm32)
uses: actions/download-artifact@v3
with:
name: ubuntu-latest-arm32-build
path: Platform/libs/libarm
- name: Display structure of libs
run: ls -R
working-directory: Platform/libs
Expand Down
6 changes: 6 additions & 0 deletions Framework/Foster.Framework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
<Pack>True</Pack>
<Link>libFosterPlatform.so</Link>
</Content>
<Content Include="$(NativeLibsDir)libarm\libFosterPlatform.so">
<CopyToOutputDirectory Condition="$([MSBuild]::IsOSPlatform('Linux')) AND '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm'">PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes\linux-arm\native</PackagePath>
<Pack>True</Pack>
<Link>libFosterPlatform.so</Link>
</Content>
<Content Include="$(NativeLibsDir)osx\libFosterPlatform.dylib">
<CopyToOutputDirectory Condition="$([MSBuild]::IsOSPlatform('OSX'))">PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes\osx\native</PackagePath>
Expand Down
4 changes: 4 additions & 0 deletions Platform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ elseif (WIN32)
elseif (UNIX)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(FosterTarget libarm64)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
set(FosterTarget libarm)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv6l")
set(FosterTarget libarm)
else()
set(FosterTarget lib64)
endif()
Expand Down
Binary file added Platform/libs/libarm/libFosterPlatform.so
Binary file not shown.
Binary file modified Platform/libs/osx/libFosterPlatform.dylib
Binary file not shown.
Binary file modified Platform/libs/x64/FosterPlatform.dll
Binary file not shown.
Loading