Skip to content

Commit 6127cf9

Browse files
authored
Merge pull request #62 from theofficialgman/main
add ARM32 Linux
2 parents 274824e + a554343 commit 6127cf9

File tree

6 files changed

+33
-1
lines changed

6 files changed

+33
-1
lines changed

.github/workflows/build-libs.yml

+23-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ jobs:
2929
- os: ubuntu-latest
3030
arch: arm64
3131
lib: libarm64/libFosterPlatform.so
32+
- os: ubuntu-latest
33+
arch: arm32
34+
lib: libarm/libFosterPlatform.so
3235
runs-on: ${{matrix.os}}
3336
steps:
3437
- name: Checkout
@@ -51,12 +54,26 @@ jobs:
5154
sudo dpkg --add-architecture arm64
5255
sudo apt-get update
5356
sudo apt-get install -y libsdl2-dev:arm64 libwayland-dev:arm64 libegl-dev:arm64 libdrm-dev:arm64 libxkbcommon-dev:arm64 libpulse-dev:arm64
57+
- name: Setup Linux dependencies (arm32)
58+
if: ${{ runner.os == 'Linux' && matrix.arch == 'arm32' }}
59+
run: |
60+
sudo apt-get update
61+
sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf
62+
sudo sed -i "s/^deb/deb [arch=amd64,i386]/g" /etc/apt/sources.list
63+
echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ $(lsb_release -s -c) main universe multiverse restricted" | sudo tee -a /etc/apt/sources.list
64+
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
65+
sudo dpkg --add-architecture armhf
66+
sudo apt-get update
67+
sudo apt-get install -y libsdl2-dev:armhf libwayland-dev:armhf libegl-dev:armhf libdrm-dev:armhf libxkbcommon-dev:armhf libpulse-dev:armhf
5468
- name: CMake Configure
55-
if: ${{ matrix.arch != 'arm64' }}
69+
if: ${{ matrix.arch != 'arm64' && matrix.arch != 'arm32' }}
5670
run: cmake -B build -S Platform
5771
- name: CMake Configure (arm64)
5872
if: ${{ runner.os == 'Linux' && matrix.arch == 'arm64' }}
5973
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
74+
- name: CMake Configure (arm32)
75+
if: ${{ runner.os == 'Linux' && matrix.arch == 'arm32' }}
76+
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
6077
- name: CMake Build
6178
run: cmake --build build --config Release
6279
- name: Publish Artifact
@@ -91,6 +108,11 @@ jobs:
91108
with:
92109
name: ubuntu-latest-arm64-build
93110
path: Platform/libs/libarm64
111+
- name: Download ubuntu lib (arm32)
112+
uses: actions/download-artifact@v3
113+
with:
114+
name: ubuntu-latest-arm32-build
115+
path: Platform/libs/libarm
94116
- name: Display structure of libs
95117
run: ls -R
96118
working-directory: Platform/libs

Framework/Foster.Framework.csproj

+6
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@
4343
<Pack>True</Pack>
4444
<Link>libFosterPlatform.so</Link>
4545
</Content>
46+
<Content Include="$(NativeLibsDir)libarm\libFosterPlatform.so">
47+
<CopyToOutputDirectory Condition="$([MSBuild]::IsOSPlatform('Linux')) AND '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm'">PreserveNewest</CopyToOutputDirectory>
48+
<PackagePath>runtimes\linux-arm\native</PackagePath>
49+
<Pack>True</Pack>
50+
<Link>libFosterPlatform.so</Link>
51+
</Content>
4652
<Content Include="$(NativeLibsDir)osx\libFosterPlatform.dylib">
4753
<CopyToOutputDirectory Condition="$([MSBuild]::IsOSPlatform('OSX'))">PreserveNewest</CopyToOutputDirectory>
4854
<PackagePath>runtimes\osx\native</PackagePath>

Platform/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ elseif (WIN32)
4242
elseif (UNIX)
4343
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
4444
set(FosterTarget libarm64)
45+
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
46+
set(FosterTarget libarm)
47+
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv6l")
48+
set(FosterTarget libarm)
4549
else()
4650
set(FosterTarget lib64)
4751
endif()
1.8 MB
Binary file not shown.
0 Bytes
Binary file not shown.

Platform/libs/x64/FosterPlatform.dll

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)