Skip to content

Commit

Permalink
More native fies
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Slusny <[email protected]>
  • Loading branch information
deathbeam committed Nov 3, 2024
1 parent 08b9eb5 commit ba22939
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/build-natives.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,15 @@ jobs:
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get clean
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
# Install crossbuild essentials first
sudo apt-get install -y \
crossbuild-essential-arm64 \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
libc6-dev-arm64-cross
sudo apt-get install -y \
gcc-multilib \
libgl1-mesa-dev:arm64 \
libglfw3:arm64 \
Expand All @@ -98,7 +106,6 @@ jobs:
libxfixes-dev:arm64 \
libwayland-dev:arm64 \
libxkbcommon-dev:arm64
# crossbuild-essential-arm64
- name: Setup EMSDK
if: matrix.runtime == 'browser-wasm'
Expand Down
22 changes: 8 additions & 14 deletions src/Raylib.NET.Native/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,14 @@ pub fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize:

// Idk why this is needed
if (target.result.os.tag == .linux) {
lib.addLibraryPath(.{ .cwd_relative = "/usr/lib" });
lib.addIncludePath(.{ .cwd_relative = "/usr/include" });

// Add architecture-specific paths based on target CPU
switch (target.result.cpu.arch) {
.x86_64 => {
lib.addLibraryPath(.{ .cwd_relative = "/usr/lib/x86_64-linux-gnu/" });
lib.addIncludePath(.{ .cwd_relative = "/usr/include/x86_64-linux-gnu/" });
},
.aarch64 => {
lib.addLibraryPath(.{ .cwd_relative = "/usr/lib/aarch64-linux-gnu/" });
lib.addIncludePath(.{ .cwd_relative = "/usr/include/aarch64-linux-gnu/" });
},
else => {}, // Handle other architectures if needed
if (target.result.cpu.arch == .aarch64) {
lib.addLibraryPath(.{ .cwd_relative = "/usr/lib/aarch64-linux-gnu/" });
lib.addIncludePath(.{ .cwd_relative = "/usr/include/aarch64-linux-gnu/" });
} else {
lib.addLibraryPath(.{ .cwd_relative = "/usr/lib" });
lib.addIncludePath(.{ .cwd_relative = "/usr/include" });
lib.addLibraryPath(.{ .cwd_relative = "/usr/lib/x86_64-linux-gnu/" });
lib.addIncludePath(.{ .cwd_relative = "/usr/include/x86_64-linux-gnu/" });
}
}

Expand Down

0 comments on commit ba22939

Please sign in to comment.