8000 This is the Silk.NET Mobile Update (v2.22.0) by Beyley · Pull Request #2184 · dotnet/Silk.NET · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

This is the Silk.NET Mobile Update (v2.22.0) #2184

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

Merged
merged 83 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
8518d32
Regen Bindings
Beyley May 22, 2024
f64b57b
oops webgpu was borked
Beyley May 22, 2024
4e912ab
Update Wgpu binaries (#2186)
silkdotnet May 22, 2024
f2af5b5
newer wgpu
Beyley May 22, 2024
b60b725
Update Wgpu binaries (#2189)
silkdotnet May 22, 2024
41e7d46
Fix vkd3d compilation
Beyley May 23, 2024
44a450e
shader spirv cross reflect c
Beyley May 23, 2024
02bc9ef
Update Shaderc binaries (#2194)
silkdotnet May 29, 2024
9ddeeef
Update SPIRV-Cross binaries (#2193)
silkdotnet May 29, 2024
7df1b90
Update SPIRV-Reflect binaries (#2192)
silkdotnet May 29, 2024
ce0ea9f
Update Vkd3d binaries (#2191)
silkdotnet May 29, 2024
bad0110
Update SwiftShader binaries (#2190)
silkdotnet May 29, 2024
471738e
Update MoltenVK binaries (#2188)
silkdotnet May 29, 2024
8c5ce0a
Update SDL2 binaries (#2187)
silkdotnet May 29, 2024
25edb6a
Update Vulkan Loader binaries (#2185)
silkdotnet May 29, 2024
6727c01
Update Core.cs
Perksey Oct 22, 2024
7099570
shaderc: swap out linux runner for windows runner
Beyley Oct 22, 2024
2a302e1
shaderc: grab dotnet 8.0.x
Beyley Oct 22, 2024
4c5e189
manually invoke git-sync-deps with python
Beyley Oct 22, 2024
604fdeb
shaderc: surround the linux target with quotes
Beyley Oct 22, 2024
28803f8
Vulkan Loader: Enable verbose build for CMake
Perksey Oct 24, 2024
cad9f09
Kick off all CI jobs - progress check
Perksey Oct 28, 2024
a4631d9
Fix SDL2 linux build error, update some runner images
Perksey Oct 28, 2024
f3d3b24
Revert to jammy
Perksey Oct 28, 2024
8df72bc
Update Vkd3d binaries (#2311)
silkdotnet Oct 28, 2024
d036e38
Update DXVK binaries (#2310)
silkdotnet Oct 28, 2024
3de7e2f
Update MoltenVK binaries (#2309)
silkdotnet Oct 28, 2024
84d5dd6
Update Assimp binaries (#2305)
silkdotnet Oct 28, 2024
1afd958
Update Wgpu binaries (#2304)
silkdotnet Oct 28, 2024
dbafa04
Update SPIRV-Cross binaries (#2308)
silkdotnet Oct 28, 2024
49cfc85
Update OpenALSoft binaries (#2302)
silkdotnet Oct 28, 2024
b03537c
Update GLFW binaries (#2300)
silkdotnet Oct 28, 2024
8b1a19a
Update SPIRV-Reflect binaries (#2303)
silkdotnet Oct 28, 2024
6f709a9
Update Shaderc binaries (#2313)
silkdotnet Oct 28, 2024
a99bba0
Use zig cc for SwiftShader on Linux
Perksey Oct 29, 2024
8b18779
Someone forgot to commit the new NUKE scripts
Perksey Oct 30, 2024
3b83080
Use matrix for SwiftShader, disable GNU assembler for Vulkan Loader
Perksey Oct 30, 2024
4a4aa48
Meant to use Where instead of Select lmao
Perksey Oct 30, 2024
fbca720
Fix NUKE execution matrix workflow error
Perksey Oct 30, 2024
1031869
Kick off Vulkan loader
Perksey Oct 30, 2024
ca28a8f
What if we just use GCC as the assembler
Perksey Oct 31, 2024
d68a1bf
Fix win-arm64 vulkan loader cmake
Perksey Oct 31, 2024
2c216b1
Remove VERBOSE from Vulkan Loader, and reduce subs in regen workflow
Perksey Oct 31, 2024
49cd1bf
Clone submodules non-recursively in bindings regen
Perksey Oct 31, 2024
06b412a
We don't need the NUKE global tool
Perksey Oct 31, 2024
695fbc9
Attempt to mitigate workload signing errors
Perksey Oct 31, 2024
772fe1b
Fine, didn't want the workloads anyway. :C
Perksey Oct 31, 2024
b74f286
Allow restore to be implicit
Perksey Oct 31, 2024
852c12a
God this branch is ancient
Perksey Oct 31, 2024
8528837
Silly fixes: fix #2298, fix #2238, fix #2128
Perksey Oct 31, 2024
18dd699
Fix ImplementedFunction serialization error
Perksey Oct 31, 2024
e4191ca
Fix webgpu regen error
Perksey Oct 31, 2024
b377db8
Fix ToString change being applied to wrong structs
Perksey Oct 31, 2024
13ef048
New binaries for DXVK on Linux 6.5.0-1025-azure #26~22.04.1-Ubuntu SM…
silkdotnet Oct 31, 2024
2ae4e53
New binaries for MoltenVK on Darwin 22.6.0 Darwin Kernel Version 22.6…
silkdotnet Oct 31, 2024
37e6d1e
New binaries for ANGLE on Darwin 22.6.0 Darwin Kernel Version 22.6.0:…
silkdotnet Oct 31, 2024
cb1538e
New binaries for Wgpu on Microsoft Windows 10.0.20348 (#2324)
silkdotnet Oct 31, 2024
4bedc04
Update Assimp binaries (#2320)
silkdotnet Oct 31, 2024
33555fb
Update OpenALSoft binaries (#2319)
silkdotnet Oct 31, 2024
8d7ad80
Update GLFW binaries (#2318)
silkdotnet Oct 31, 2024
a8fa0d2
Update SwiftShader binaries (#2312)
silkdotnet Oct 31, 2024
3c1482c
Fix member name being same as type name, @tonisimakov99 review comment
Perksey Oct 31, 2024
9c31583
Merge branch 'feature/regen' of https://github.com/dotnet/Silk.NET in…
Perksey Oct 31, 2024
7de1a2e
Not sure why non-universal ANGLE reappeared
Perksey Oct 31, 2024
10a4edc
Fix #2240
Perksey Nov 1, 2024
9d2c8ae
Regenerate bindings as of 31/10/2024 (#2322)
silkdotnet Nov 1, 2024
943f5bd
Revert invalid submodule reference updates
Perksey Nov 1, 2024
b6271e3
Update some versioned APIs again
Perksey Nov 1, 2024
be70562
Update patch notes
Perksey Nov 1, 2024
9872edf
New binaries for SPIRV-Cross on Linux 6.5.0-1025-azure #26~22.04.1-Ub…
silkdotnet Nov 1, 2024
0b91d6c
Update Assimp as well
Perksey Nov 1, 2024
cbabce7
Update Assimp config
Perksey Nov 1, 2024
049c772
Regenerated bindings as of 01/11/2024 (16:37:09) (#2337)
silkdotnet Nov 1, 2024
401a905
Attempt to fix Assimp Linux build
Perksey Nov 1, 2024
e07cfa9
Merge branch 'feature/regen' of https://github.com/dotnet/Silk.NET in…
Perksey Nov 1, 2024
5821a74
Fixes from self-review
Perksey Nov 1, 2024
0e94a6d
Regenerated bindings as of 01/11/2024 (21:49:32)
dotnet-bot Nov 1, 2024
1316e03
Update Assimp binaries (#2336)
silkdotnet Nov 1, 2024
2e79b8c
Update SDL2 binaries (#2333)
silkdotnet Nov 1, 2024
084409e
New binaries for SPIRV-Reflect on Linux 6.5.0-1025-azure #26~22.04.1-…
silkdotnet Nov 1, 2024
0914832
New binaries for Vkd3d on Linux 6.5.0-1025-azure #26~22.04.1-Ubuntu S…
silkdotnet Nov 1, 2024
f536ca6
New binaries for MoltenVK on Darwin 22.6.0 Darwin Kernel Version 22.6…
silkdotnet Nov 1, 2024
fede822
Update Vulkan Loader binaries (#2301)
silkdotnet Nov 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 3 additions & 6 deletions .github/workflows/bindings-regeneration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ jobs:
token: ${{ secrets.PUSHABLE_GITHUB_TOKEN }}
- name: Checkout submodules, configure git.
run: |
git -c submodule.third_party/git-hooks.update=none submodule update --init --recursive
# Keep this in sync with generator.json!
git -c submodule.third_party/git-hooks.update=none submodule update --init --depth 0 build/submodules/Vulkan-Headers build/submodules/Assimp build/submodules/SDL build/submodules/webgpu-headers build/submodules/dawn build/submodules/SPIRV-Headers build/submodules/SPIRV-Reflect build/submodules/SPIRV-Cross build/submodules/shaderc
git submodule update --init --depth 0 --recursive build/submodules/wgpu-native
git config --local user.email "9011267+dotnet-bot@users.noreply.github.com"
git config --local user.name "The Silk.NET Automaton"
- name: Setup .NET Core
Expand Down Expand Up @@ -44,11 +46,6 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.404
- name: Setup NUKE
run: dotnet tool install Nuke.GlobalTool --global
- name: Install Workloads
# TODO: This is slow. Maybe we can make a docker container with this already done?
run: dotnet workload install android ios maccatalyst
- uses: GuillaumeFalourd/setup-windows10-sdk-action@v1.9
name: Setup Windows 11 SDK
with:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/shaderc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ jobs:
fail-fast: false
matrix:
env:
- os: ubuntu-latest
name: Linux
nuke_invoke: ./build.sh
- os: windows-2022
name: Windows
nuke_invoke: ./build.cmd
extras: ""
name: ${{ matrix.env.name }} Build
runs-on: ${{ matrix.env.os }}
steps:
Expand All @@ -43,6 +44,7 @@ jobs:
dotnet-version: |
6.0.201
7.0.*
8.0.*
- name: Build Shaderc
run: ${{ matrix.env.nuke_invoke }} Shaderc
env:
Expand Down
42 changes: 14 additions & 28 deletions .github/workflows/swiftshader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,17 @@ jobs:
matrix:
env:
- os: ubuntu-22.04
name: Linux
name: Linux x64
nuke_invoke: ./build.sh
extras: |
# We need to adjust APT sources for multiarch. Use the ones corresponding to
# Ubuntu 22.04 with appropriate `arch` values. ports.ubuntu.com is required
# for armhf and arm64.
sudo tee /etc/apt/sources.list << EOF
deb [arch=amd64] http://archive.ubuntu.com/ubuntu jammy main multiverse restricted universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu jammy-backports main multiverse restricted universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu jammy-security main multiverse restricted universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu jammy-updates main multiverse restricted universe
deb [arch=arm64,armhf] http://ports.ubuntu.com jammy main multiverse restricted universe
deb [arch=arm64,armhf] http://ports.ubuntu.com jammy-backports main multiverse restricted universe
deb [arch=arm64,armhf] http://ports.ubuntu.com jammy-security main multiverse restricted universe
deb [arch=arm64,armhf] http://ports.ubuntu.com jammy-updates main multiverse restricted universe
deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy main multiverse restricted universe
deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy-backports main multiverse restricted universe
deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy-security main multiverse restricted universe
deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy-updates main multiverse restricted universe
EOF
sudo dpkg --add-architecture arm64
sudo dpkg --add-architecture armhf
sudo apt update
sudo apt install -y gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf
sudo apt install -y g++-aarch64-linux-gnu g++-arm-linux-gnueabihf
for arch in amd64 arm64 armhf; do
sudo apt install -y libx11-xcb-dev:$arch
done
nuke_extra: --matrix-arg linux-x64
- os: ubuntu-22.04
name: Linux ARM32
nuke_invoke: ./build.sh
nuke_extra: --matrix-arg linux-arm
- os: ubuntu-22.04
name: Linux ARM64
nuke_invoke: ./build.sh
nuke_extra: --matrix-arg linux-arm64
- os: windows-2022
name: Windows
nuke_invoke: ./build.cmd
Expand Down Expand Up @@ -83,7 +66,10 @@ jobs:
dotnet-version: |
6.0.201
7.0.*
- name: Install Zig
if: ${{ matrix.env.os == 'ubuntu-22.04' }}
uses: goto-bus-stop/setup-zig@v2
- name: Build SwiftShader
run: ${{ matrix.env.nuke_invoke }} SwiftShader
run: ${{ matrix.env.nuke_invoke }} SwiftShader ${{ matrix.env.nuke_extra }}
env:
PUSHABLE_GITHUB_TOKEN: ${{ secrets.PUSHABLE_GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/vulkan-loader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ jobs:
for arch in amd64 arm64 armhf; do
sudo apt install -y libx11-xcb-dev:$arch libxkbcommon-dev:$arch libwayland-dev:$arch libxrandr-dev:$arch
done
wget https://github.com/mstorsjo/llvm-mingw/releases/download/20240417/llvm-mingw-20240417-msvcrt-ubuntu-20.04-x86_64.tar.xz
wget https://github.com/mstorsjo/llvm-mingw/releases/download/20241015/llvm-mingw-20241015-msvcrt-ubuntu-20.04-x86_64.tar.xz
sudo mkdir /opt/llvm-mingw-msvcrt
sudo tar xf llvm-mingw-20240417-msvcrt-ubuntu-20.04-x86_64.tar.xz --strip-components 1 -C /opt/llvm-mingw-msvcrt
rm llvm-mingw-20240417-msvcrt-ubuntu-20.04-x86_64.tar.xz
sudo tar xf llvm-mingw-20241015-msvcrt-ubuntu-20.04-x86_64.tar.xz --strip-components 1 -C /opt/llvm-mingw-msvcrt
rm llvm-mingw-20241015-msvcrt-ubuntu-20.04-x86_64.tar.xz
- os: windows-2022
name: Windows
nuke_invoke: ./build.cmd
Expand Down
4 changes: 4 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
"VSCode"
]
},
"MatrixArg": {
"type": "string",
"description": "Matrix job argument e.g. a RID for native builds"
},
"MsbuildProperties": {
"type": "array",
"description": "Extra properties passed to MSBuild commands",
Expand Down
Binary file modified build/cache/assimp.json.gz
Binary file not shown.
Binary file modified build/cache/cl.json.gz
Binary file not shown.
Binary file modified build/cache/core.json.gz
Binary file not shown.
Binary file modified build/cache/d2d.json.gz
Binary file not shown.
Binary file modified build/cache/d3d11.json.gz
Binary file not shown.
Binary file modified build/cache/d3d12.json.gz
Binary file not shown.
Binary file modified build/cache/d3d9.json.gz
Binary file not shown.
Binary file modified build/cache/d3dcompiler.json.gz
Binary file not shown.
Binary file modified build/cache/dcomp.json.gz
Binary file not shown.
Binary file modified build/cache/dstorage.json.gz
Binary file not shown.
Binary file modified build/cache/dwrite.json.gz
Binary file not shown.
Binary file modified build/cache/dxc.json.gz
Binary file not shown.
Binary file modified build/cache/dxgi.json.gz
Binary file not shown.
Binary file modified build/cache/dxva.json.gz
Binary file not shown.
Binary file modified build/cache/gl.json.gz
Binary file not shown.
Binary file modified build/cache/glcore.json.gz
Binary file not shown.
Binary file modified build/cache/gles2.json.gz
Binary file not shown.
Binary file modified build/cache/openxr.json.gz
Binary file not shown.
Binary file modified build/cache/sdl.json.gz
Binary file not shown.
Binary file modified build/cache/shaderc.json.gz
Binary file not shown.
Binary file modified build/cache/spirv-cross.json.gz
Binary file not shown.
Binary file modified build/cache/spirv-reflect.json.gz
Binary file not shown.
Binary file modified build/cache/spirv.json.gz
Binary file not shown.
Binary file modified build/cache/vulkan.json.gz
Binary file not shown.
Binary file modified build/cache/vulkan_video.json.gz
Binary file not shown.
Binary file modified build/cache/webgpu.json.gz
Binary file not shown.
Binary file modified build/cache/wgl.json.gz
Binary file not shown.
Binary file modified build/cache/wic.json.gz
Binary file not shown.
Binary file modified build/cache/win32extras.json.gz
Binary file not shown.
Binary file modified build/cache/xaudio.json.gz
Binary file not shown.
Binary file modified build/cache/xinput.json.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion build/cmake/aarch64-linux-gnu.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "aarch64")

set(CMAKE_ASM_COMPILER "/usr/bin/aarch64-linux-gnu-as")
set(CMAKE_ASM_COMPILER "/usr/bin/aarch64-linux-gnu-gcc")
set(CMAKE_C_COMPILER "/usr/bin/aarch64-linux-gnu-gcc")
set(CMAKE_CXX_COMPILER "/usr/bin/aarch64-linux-gnu-g++")

Expand Down
20 changes: 10 additions & 10 deletions build/cmake/aarch64-w64-mingw32.cmake
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
set(CMAKE_SYSTEM_NAME "Windows")
set(CMAKE_SYSTEM_PROCESSOR "aarch64")

set(CMAKE_ASM_COMPILER "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-as")
set(CMAKE_ASM_COMPILER "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-gcc")
set(CMAKE_C_COMPILER "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-gcc")
set(CMAKE_CXX_COMPILER "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-g++")
set(CMAKE_RC_COMPILER "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-windres")

set(CMAKE_ADDR2LINE "/usr/bin/aarch64-w64-mingw32-addr2line")
set(CMAKE_AR "/usr/bin/aarch64-w64-mingw32-ar")
set(CMAKE_DLLTOOL "/usr/bin/aarch64-w64-mingw32-dlltool")
set(CMAKE_ADDR2LINE "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-addr2line")
set(CMAKE_AR "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-ar")
set(CMAKE_DLLTOOL "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-dlltool")
set(CMAKE_LINKER "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-ld")
set(CMAKE_NM "/usr/bin/aarch64-w64-mingw32-nm")
set(CMAKE_OBJCOPY "/usr/bin/aarch64-w64-mingw32-objcopy")
set(CMAKE_OBJDUMP "/usr/bin/aarch64-w64-mingw32-objdump")
set(CMAKE_RANLIB "/usr/bin/aarch64-w64-mingw32-ranlib")
set(CMAKE_READELF "/usr/bin/aarch64-w64-mingw32-readelf")
set(CMAKE_STRIP "/usr/bin/aarch64-w64-mingw32-strip")
set(CMAKE_NM "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-nm")
set(CMAKE_OBJCOPY "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-objcopy")
set(CMAKE_OBJDUMP "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-objdump")
set(CMAKE_RANLIB "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-ranlib")
set(CMAKE_READELF "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-readelf")
set(CMAKE_STRIP "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-strip")

set(CMAKE_FIND_ROOT_PATH "/opt/llvm-mingw-msvcrt/aarch64-w64-mingw32")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
Expand Down
2 changes: 1 addition & 1 deletion build/cmake/arm-linux-gnueabihf.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "armv7l")

set(CMAKE_ASM_COMPILER "/usr/bin/arm-linux-gnueabihf-as")
set(CMAKE_ASM_COMPILER "/usr/bin/arm-linux-gnueabihf-gcc")
set(CMAKE_C_COMPILER "/usr/bin/arm-linux-gnueabihf-gcc")
set(CMAKE_CXX_COMPILER "/usr/bin/arm-linux-gnueabihf-g++")

Expand Down
36 changes: 36 additions & 0 deletions build/cmake/fudge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Origignal script from https://github.com/ziglang/zig/issues/4911
# Modified to add SILKDOTNET_ paths in response to some issues with SwiftShader

args=""
for arg in "$@"
do
parg="$arg"

option=${arg%=*}
target=${arg#*=}
if [[ $option == "-march" || $option == "-mcpu" || $option == "-mtune" ]]; then
moveon=0
for replace in $SILKDOTNET_ReplaceArchitectureZigCcFlags
do
replacetarget=${replace%=*}
replacement=${replace#*=}
# echo $replacetarget A $replacement B $target END
if [[ $replacetarget == $target ]]; then
if [[ "$replacement" == "" ]]; then
moveon=1
else
target="$replacement"
fi
fi
done
if [[ $moveon == 1 || "$SILKDOTNET_RemoveAllPotentiallyProblematicZigCcFlags" == "1" ]]; then
continue
else
fixedTarget=${target//-/_}
parg="$option=$fixedTarget"
fi
fi
args="$args $parg"
done
2 changes: 1 addition & 1 deletion build/cmake/x86_64-linux-gnu.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "x86_64")

set(CMAKE_ASM_COMPILER "/usr/bin/x86_64-linux-gnu-as")
set(CMAKE_ASM_COMPILER "/usr/bin/x86_64-linux-gnu-gcc")
set(CMAKE_C_COMPILER "/usr/bin/x86_64-linux-gnu-gcc")
set(CMAKE_CXX_COMPILER "/usr/bin/x86_64-linux-gnu-g++")

Expand Down
2 changes: 2 additions & 0 deletions build/cmake/zig-ar.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
zig ar %*
2 changes: 2 additions & 0 deletions build/cmake/zig-ar.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
zig ar "$@"
3 changes: 3 additions & 0 deletions build/cmake/zig-c++.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
: TODO add -march/-mtune handling if necessary
zig c++ %*
3 changes: 3 additions & 0 deletions build/cmake/zig-c++.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
. "$(dirname ${BASH_SOURCE[0]})/fudge.sh" $args
zig c++ $args
3 changes: 3 additions & 0 deletions build/cmake/zig-cc.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
: TODO add -march/-mtune handling if necessary
zig cc %*
3 changes: 3 additions & 0 deletions build/cmake/zig-cc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
. "$(dirname ${BASH_SOURCE[0]})/fudge.sh" $args
zig cc $args
2 changes: 2 additions & 0 deletions build/cmake/zig-ranlib.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
zig ranlib %*
2 changes: 2 additions & 0 deletions build/cmake/zig-ranlib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
zig ranlib "$@"
2 changes: 2 additions & 0 deletions build/cmake/zig-rc.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
zig rc %*
2 changes: 2 additions & 0 deletions build/cmake/zig-rc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
zig rc "$@"
2 changes: 2 additions & 0 deletions build/cmake/zig-toolchain-aarch64-linux-gnu.2.17.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set(ZIG_TARGET "aarch64-linux-gnu.2.17")
include(${CMAKE_CURRENT_LIST_DIR}/zig-toolchain.cmake)
2 changes: 2 additions & 0 deletions build/cmake/zig-toolchain-arm-linux-gnueabihf.2.17.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set(ZIG_TARGET "arm-linux-gnueabihf.2.17")
include(${CMAKE_CURRENT_LIST_DIR}/zig-toolchain.cmake)
2 changes: 2 additions & 0 deletions build/cmake/zig-toolchain-x86_64-linux-gnu.2.17.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set(ZIG_TARGET "x86_64-linux-gnu.2.17")
include(${CMAKE_CURRENT_LIST_DIR}/zig-toolchain.cmake)
40 changes: 40 additions & 0 deletions build/cmake/zig-toolchain.cmake
10000
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
include_guard()

if(CMAKE_GENERATOR MATCHES "Visual Studio")
message(FATAL_ERROR "Visual Studio generator not supported, use: cmake -G Ninja")
endif()

if(NOT ZIG_TARGET MATCHES "^([a-zZ-Z0-9_]+)-([a-zZ-Z0-9_]+)-([a-zZ-Z0-9_.]+)$")
message(FATAL_ERROR "Expected -DZIG_TARGET=<arch>-<os>-<abi>")
endif()

set(ZIG_ARCH ${CMAKE_MATCH_1})
set(ZIG_OS ${CMAKE_MATCH_2})
set(ZIG_ABI ${CMAKE_MATCH_3})

if(ZIG_OS STREQUAL "linux")
set(CMAKE_SYSTEM_NAME "Linux")
elseif(ZIG_OS STREQUAL "windows")
set(CMAKE_SYSTEM_NAME "Windows")
elseif(ZIG_OS STREQUAL "macos")
set(CMAKE_SYSTEM_NAME "Darwin")
else()
message(WARNING "Unknown OS: ${ZIG_OS}")
endif()

set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR ${ZIG_ARCH})

if(WIN32)
set(SCRIPT_SUFFIX ".cmd")
else()
set(SCRIPT_SUFFIX ".sh")
endif()

# This is working (thanks to Simon for finding this trick)
set(CMAKE_AR "${CMAKE_CURRENT_LIST_DIR}/zig-ar${SCRIPT_SUFFIX}")
set(CMAKE_RANLIB "${CMAKE_CURRENT_LIST_DIR}/zig-ranlib${SCRIPT_SUFFIX}")
set(CMAKE_RC_COMPILER "${CMAKE_CURRENT_LIST_DIR}/zig-rc${SCRIPT_SUFFIX}")
set(CMAKE_ASM_COMPILER "${CMAKE_CURRENT_LIST_DIR}/zig-cc${SCRIPT_SUFFIX}" -target ${ZIG_TARGET})
set(CMAKE_C_COMPILER "${CMAKE_CURRENT_LIST_DIR}/zig-cc${SCRIPT_SUFFIX}" -target ${ZIG_TARGET})
set(CMAKE_CXX_COMPILER "${CMAKE_CURRENT_LIST_DIR}/zig-c++${SCRIPT_SUFFIX}" -target ${ZIG_TARGET})
1 change: 0 additions & 1 deletion build/nuke/Build.Generation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ partial class Build
Target RegenerateBindings => CommonTarget
(
x => x.After(Clean)
.DependsOn(Restore)
.Executes
(
() =>
Expand Down
12 changes: 8 additions & 4 deletions build/nuke/Build.Support.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ partial class Build
[Nuke.Common.Parameter("Outputs build warnings instead of keeping the MSBuild logging quiet with just errors.")]
bool Warnings;

[Parameter("Matrix job argument e.g. a RID for native builds."), CanBeNull]
string MatrixArg;

static int IndexOfOrThrow(string x, char y)
{
var idx = x.IndexOf(y);
Expand All @@ -49,15 +52,16 @@ static int IndexOfOrThrow(string x, char y)
return idx;
}

Dictionary<string, string> CreateEnvVarDictionary()
Dictionary<string, string> CreateEnvVarDictionary([CanBeNull] IReadOnlyDictionary<string, string> concat = null)
=> Environment.GetEnvironmentVariables()
.Cast<DictionaryEntry>()
.Concat((concat ?? Enumerable.Empty<KeyValuePair<string, string>>()).Select(x => new DictionaryEntry(x.Key, x.Value)))
.ToDictionary(x => (string) x.Key, x => (string) x.Value);

IProcess InheritedShell(string cmd, [CanBeNull] string workDir = null)
IProcess InheritedShell(string cmd, [CanBeNull] string workDir = null, [CanBeNull] IReadOnlyDictionary<string, string> envVars = null)
=> OperatingSystem.IsWindows()
? StartProcess("powershell", $"-Command {cmd.DoubleQuote()}", workDir, CreateEnvVarDic 10000 tionary())
: StartProcess("bash", $"-c {cmd.DoubleQuote()}", workDir, CreateEnvVarDictionary());
? StartProcess("powershell", $"-Command {cmd.DoubleQuote()}", workDir, CreateEnvVarDictionary(envVars))
: StartProcess("bash", $"-c {cmd.DoubleQuote()}", workDir, CreateEnvVarDictionary(envVars));

void AddToPath(string dir)
{
Expand Down
2 changes: 1 addition & 1 deletion build/nuke/Native/Assimp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ partial class Build {
var buildDir = AssimpPath / "build";
var runtimes = RootDirectory / "src" / "Native" / "Silk.NET.Assimp.Native" / "runtimes";

var prepare = "cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DASSIMP_WARNINGS_AS_ERRORS=OFF -DASSIMP_BUILD_TESTS=OFF";
var prepare = "cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DASSIMP_BUILD_ZLIB=ON -DASSIMP_WARNINGS_AS_ERRORS=OFF -DASSIMP_BUILD_TESTS=OFF";
var build = $"cmake --build . --config Release{JobsArg}";

if (OperatingSystem.IsWindows())
Expand Down
2 changes: 1 addition & 1 deletion build/nuke/Native/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void PrUpdatedNativeBinary(string name)
$"git commit -m \"New binaries for {name} on {RuntimeInformation.OSDescription}\""
)
.AssertWaitForExit();
if (!commitCmd.Output.Any(x => x.Text.Contains("no changes added to commit", StringComparison.OrdinalIgnoreCase) || x.Text.Contains("nothing to commit", StringComparison.OrdinalIgnoreCase)))
if (!commitCmd.Output.Any(x => x.Text.Contains("no changes added to commit", StringComparison.OrdinalIgnoreCase) || x.Text.Contains("nothing", StringComparison.OrdinalIgnoreCase)))
{
commitCmd.AssertZeroExitCode();
}
Expand Down
6 changes: 3 additions & 3 deletions build/nuke/Native/SPIRVCross.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ pub fn build(b: *std.Build) void {
{ //Windows
//Build for Windows x86_64
InheritedShell($"zig build {releaseMode} -Dtarget=x86_64-windows --verbose", SPIRVCrossPath).AssertZeroExitCode();
CopyFile(SPIRVCrossPath / "zig-out" / "lib" / "spirv-cross.dll", runtimes / "win-x64" / "native" / "spirv-cross.dll", FileExistsPolicy.Overwrite);
CopyFile(SPIRVCrossPath / "zig-out" / "bin" / "spirv-cross.dll", runtimes / "win-x64" / "native" / "spirv-cross.dll", FileExistsPolicy.Overwrite);

//Build for Windows x86
InheritedShell($"zig build {releaseMode} -Dtarget=x86-windows --verbose", SPIRVCrossPath).AssertZeroExitCode();
CopyFile(SPIRVCrossPath / "zig-out" / "lib" / "spirv-cross.dll", runtimes / "win-x86" / "native" / "spirv-cross.dll", FileExistsPolicy.Overwrite);
CopyFile(SPIRVCrossPath / "zig-out" / "bin" / "spirv-cross.dll", runtimes / "win-x86" / "native" / "spirv-cross.dll", FileExistsPolicy.Overwrite);

//Build for Windows arm64
InheritedShell($"zig build {releaseMode} -Dtarget=aarch64-windows --verbose", SPIRVCrossPath).AssertZeroExitCode();
CopyFile(SPIRVCrossPath / "zig-out" / "lib" / "spirv-cross.dll", runtimes / "win-arm64" / "native" / "spirv-cross.dll", FileExistsPolicy.Overwrite);
CopyFile(SPIRVCrossPath / "zig-out" / "bin" / "spirv-cross.dll", runtimes / "win-arm64" / "native" / "spirv-cross.dll", FileExistsPolicy.Overwrite);
}

{ //MacOS
Expand Down
Loading
Loading
0