Skip to content

Commit c940b96

Browse files
committed
Merge remote-tracking branch 'origin/main' into proposal/windowing-3.0
2 parents 35ab26e + e3f057d commit c940b96

File tree

1,021 files changed

+333027
-10601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,021 files changed

+333027
-10601
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@ updates:
66
schedule:
77
interval: weekly
88
day: thursday
9+
groups:
10+
All 2.X Dependencies:
11+
patterns:
12+
- "*"
913
- package-ecosystem: nuget
1014
target-branch: develop/3.0
1115
directory: "/"
1216
schedule:
1317
interval: weekly
1418
day: thursday
19+
groups:
20+
All 3.0 Dependencies:
21+
patterns:
22+
- "*"

.github/workflows/bindings-regeneration.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ jobs:
1616
token: ${{ secrets.PUSHABLE_GITHUB_TOKEN }}
1717
- name: Checkout submodules, configure git.
1818
run: |
19-
git -c submodule.third_party/git-hooks.update=none submodule update --init --recursive
19+
# Keep this in sync with generator.json!
20+
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
21+
git submodule update --init --depth 0 --recursive build/submodules/wgpu-native
2022
git config --local user.email "9011267+dotnet-bot@users.noreply.github.com"
2123
git config --local user.name "The Silk.NET Automaton"
2224
- name: Setup .NET Core
@@ -44,11 +46,6 @@ jobs:
4446
uses: actions/setup-dotnet@v1
4547
with:
4648
dotnet-version: 3.1.404
47-
- name: Setup NUKE
48-
run: dotnet tool install Nuke.GlobalTool --global
49-
- name: Install Workloads
50-
# TODO: This is slow. Maybe we can make a docker container with this already done?
51-
run: dotnet workload install android ios maccatalyst
5249
- uses: GuillaumeFalourd/setup-windows10-sdk-action@v1.9
5350
name: Setup Windows 11 SDK
5451
with:

.github/workflows/shaderc.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
env:
20-
- os: ubuntu-latest
21-
name: Linux
22-
nuke_invoke: ./build.sh
20+
- os: windows-2022
21+
name: Windows
22+
nuke_invoke: ./build.cmd
23+
extras: ""
2324
name: ${{ matrix.env.name }} Build
2425
runs-on: ${{ matrix.env.os }}
2526
steps:
@@ -43,6 +44,7 @@ jobs:
4344
dotnet-version: |
4445
6.0.201
4546
7.0.*
47+
8.0.*
4648
- name: Build Shaderc
4749
run: ${{ matrix.env.nuke_invoke }} Shaderc
4850
env:

.github/workflows/swiftshader.yml

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,17 @@ jobs:
1919
matrix:
2020
env:
2121
- os: ubuntu-22.04
22-
name: Linux
22+
name: Linux x64
2323
nuke_invoke: ./build.sh
24-
extras: |
25-
# We need to adjust APT sources for multiarch. Use the ones corresponding to
26-
# Ubuntu 22.04 with appropriate `arch` values. ports.ubuntu.com is required
27-
# for armhf and arm64.
28-
sudo tee /etc/apt/sources.list << EOF
29-
deb [arch=amd64] http://archive.ubuntu.com/ubuntu jammy main multiverse restricted universe
30-
deb [arch=amd64] http://archive.ubuntu.com/ubuntu jammy-backports main multiverse restricted universe
31-
deb [arch=amd64] http://archive.ubuntu.com/ubuntu jammy-security main multiverse restricted universe
32-
deb [arch=amd64] http://archive.ubuntu.com/ubuntu jammy-updates main multiverse restricted universe
33-
deb [arch=arm64,armhf] http://ports.ubuntu.com jammy main multiverse restricted universe
34-
deb [arch=arm64,armhf] http://ports.ubuntu.com jammy-backports main multiverse restricted universe
35-
deb [arch=arm64,armhf] http://ports.ubuntu.com jammy-security main multiverse restricted universe
36-
deb [arch=arm64,armhf] http://ports.ubuntu.com jammy-updates main multiverse restricted universe
37-
deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy main multiverse restricted universe
38-
deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy-backports main multiverse restricted universe
39-
deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy-security main multiverse restricted universe
40-
deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy-updates main multiverse restricted universe
41-
EOF
42-
sudo dpkg --add-architecture arm64
43-
sudo dpkg --add-architecture armhf
44-
sudo apt update
45-
sudo apt install -y gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf
46-
sudo apt install -y g++-aarch64-linux-gnu g++-arm-linux-gnueabihf
47-
for arch in amd64 arm64 armhf; do
48-
sudo apt install -y libx11-xcb-dev:$arch
49-
done
24+
nuke_extra: --matrix-arg linux-x64
25+
- os: ubuntu-22.04
26+
name: Linux ARM32
27+
nuke_invoke: ./build.sh
28+
nuke_extra: --matrix-arg linux-arm
29+
- os: ubuntu-22.04
30+
name: Linux ARM64
31+
nuke_invoke: ./build.sh
32+
nuke_extra: --matrix-arg linux-arm64
5033
- os: windows-2022
5134
name: Windows
5235
nuke_invoke: ./build.cmd
@@ -83,7 +66,10 @@ jobs:
8366
dotnet-version: |
8467
6.0.201
8568
7.0.*
69+
- name: Install Zig
70+
if: ${{ matrix.env.os == 'ubuntu-22.04' }}
71+
uses: goto-bus-stop/setup-zig@v2
8672
- name: Build SwiftShader
87-
run: ${{ matrix.env.nuke_invoke }} SwiftShader
73+
run: ${{ matrix.env.nuke_invoke }} SwiftShader ${{ matrix.env.nuke_extra }}
8874
env:
8975
PUSHABLE_GITHUB_TOKEN: ${{ secrets.PUSHABLE_GITHUB_TOKEN }}

.github/workflows/vulkan-loader.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ jobs:
4646
for arch in amd64 arm64 armhf; do
4747
sudo apt install -y libx11-xcb-dev:$arch libxkbcommon-dev:$arch libwayland-dev:$arch libxrandr-dev:$arch
4848
done
49-
wget https://github.com/mstorsjo/llvm-mingw/releases/download/20240417/llvm-mingw-20240417-msvcrt-ubuntu-20.04-x86_64.tar.xz
49+
wget https://github.com/mstorsjo/llvm-mingw/releases/download/20241015/llvm-mingw-20241015-msvcrt-ubuntu-20.04-x86_64.tar.xz
5050
sudo mkdir /opt/llvm-mingw-msvcrt
51-
sudo tar xf llvm-mingw-20240417-msvcrt-ubuntu-20.04-x86_64.tar.xz --strip-components 1 -C /opt/llvm-mingw-msvcrt
52-
rm llvm-mingw-20240417-msvcrt-ubuntu-20.04-x86_64.tar.xz
51+
sudo tar xf llvm-mingw-20241015-msvcrt-ubuntu-20.04-x86_64.tar.xz --strip-components 1 -C /opt/llvm-mingw-msvcrt
52+
rm llvm-mingw-20241015-msvcrt-ubuntu-20.04-x86_64.tar.xz
5353
- os: windows-2022
5454
name: Windows
5555
nuke_invoke: ./build.cmd

.nuke/build.schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@
6767
"VSCode"
6868
]
6969
},
70+
"MatrixArg": {
71+
"type": "string",
72+
"description": "Matrix job argument e.g. a RID for native builds"
73+
},
7074
"MsbuildProperties": {
7175
"type": "array",
7276
"description": "Extra properties passed to MSBuild commands",

Silk.NET.sln

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.OpenXR.Extensions.
618618
EndProject
619619
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Assimp.Tests", "src\Assimp\Silk.NET.Assimp.Tests\Silk.NET.Assimp.Tests.csproj", "{12D0A556-7DDF-4902-8911-1DA3F6331149}"
620620
EndProject
621+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Core.Tests", "src\Core\Silk.NET.Core.Tests\Silk.NET.Core.Tests.csproj", "{4D871493-0B88-477A-99A1-3E05561CFAD9}"
622+
EndProject
621623
Global
622624
GlobalSection(SolutionConfigurationPlatforms) = preSolution
623625
Debug|Any CPU = Debug|Any CPU
@@ -3771,6 +3773,18 @@ Global
37713773
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|x64.Build.0 = Release|Any CPU
37723774
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|x86.ActiveCfg = Release|Any CPU
37733775
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|x86.Build.0 = Release|Any CPU
3776+
{4D871493-0B88-477A-99A1-3E05561CFAD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3777+
{4D871493-0B88-477A-99A1-3E05561CFAD9}.Debug|Any CPU.Build.0 = Debug|Any CPU
3778+
{4D871493-0B88-477A-99A1-3E05561CFAD9}.Debug|x64.ActiveCfg = Debug|Any CPU
3779+
{4D871493-0B88-477A-99A1-3E05561CFAD9}.Debug|x64.Build.0 = Debug|Any CPU
3780+
{4D871493-0B88-477A-99A1-3E05561CFAD9}.Debug|x86.ActiveCfg = Debug|Any CPU
3781+
{4D871493-0B88-477A-99A1-3E05561CFAD9}.Debug|x86.Build.0 = Debug|Any CPU
3782+
{4D871493-0B88-477A-99A1-3E05561CFAD9}.Release|Any CPU.ActiveCfg = Release|Any CPU
3783+
{4D871493-0B88-477A-99A1-3E05561CFAD9}.Release|Any CPU.Build.0 = Release|Any CPU
3784+
{4D871493-0B88-477A-99A1-3E05561CFAD9}.Release|x64.ActiveCfg = Release|Any CPU
3785+
{4D871493-0B88-477A-99A1-3E05561CFAD9}.Release|x64.Build.0 = Release|Any CPU
3786+
{4D871493-0B88-477A-99A1-3E05561CFAD9}.Release|x86.ActiveCfg = Release|Any CPU
3787+
{4D871493-0B88-477A-99A1-3E05561CFAD9}.Release|x86.Build.0 = Release|Any CPU
37743788
EndGlobalSection
37753789
GlobalSection(SolutionProperties) = preSolution
37763790
HideSolutionNode = FALSE
@@ -4072,6 +4086,7 @@ Global
40724086
{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0}
40734087
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0}
40744088
{12D0A556-7DDF-4902-8911-1DA3F6331149} = {6EADA376-E83F-40B7-9539-71DD17AEF7A4}
4089+
{4D871493-0B88-477A-99A1-3E05561CFAD9} = {0651C5EF-50AA-4598-8D9C-8F210ADD8490}
40754090
EndGlobalSection
40764091
GlobalSection(ExtensibilityGlobals) = postSolution
40774092
SolutionGuid = {F5273D7F-3334-48DF-94E3-41AE6816CD4D}

build/cache/assimp.json.gz

0 Bytes
Binary file not shown.

build/cache/cl.json.gz

97.1 KB
Binary file not shown.

build/cache/core.json.gz

0 Bytes
Binary file not shown.

build/cache/d2d.json.gz

0 Bytes
Binary file not shown.

build/cache/d3d11.json.gz

0 Bytes
Binary file not shown.

build/cache/d3d12.json.gz

41.5 KB
Binary file not shown.

build/cache/d3d9.json.gz

0 Bytes
Binary file not shown.

build/cache/d3dcompiler.json.gz

18.2 KB
Binary file not shown.

build/cache/dcomp.json.gz

2.5 KB
Binary file not shown.

build/cache/dstorage.json.gz

99 Bytes
Binary file not shown.

build/cache/dwrite.json.gz

0 Bytes
Binary file not shown.

build/cache/dxc.json.gz

1 KB
Binary file not shown.

build/cache/dxgi.json.gz

1.44 KB
Binary file not shown.

build/cache/dxva.json.gz

0 Bytes
Binary file not shown.

build/cache/gl.json.gz

0 Bytes
Binary file not shown.

build/cache/glcore.json.gz

0 Bytes
Binary file not shown.

build/cache/gles2.json.gz

0 Bytes
Binary file not shown.

build/cache/openxr.json.gz

31.6 KB
Binary file not shown.

build/cache/sdl.json.gz

0 Bytes
Binary file not shown.

build/cache/shaderc.json.gz

446 Bytes
Binary file not shown.

build/cache/spirv-cross.json.gz

658 Bytes
Binary file not shown.

build/cache/spirv-reflect.json.gz

0 Bytes
Binary file not shown.

build/cache/spirv.json.gz

0 Bytes
Binary file not shown.

build/cache/vulkan.json.gz

0 Bytes
Binary file not shown.

build/cache/vulkan_video.json.gz

253 Bytes
Binary file not shown.

build/cache/webgpu.json.gz

4.73 KB
Binary file not shown.

build/cache/wgl.json.gz

0 Bytes
Binary file not shown.

build/cache/wic.json.gz

0 Bytes
Binary file not shown.

build/cache/win32extras.json.gz

0 Bytes
Binary file not shown.

build/cache/xaudio.json.gz

126 Bytes
Binary file not shown.

build/cache/xinput.json.gz

190 Bytes
Binary file not shown.

build/cmake/aarch64-linux-gnu.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
set(CMAKE_SYSTEM_NAME "Linux")
22
set(CMAKE_SYSTEM_PROCESSOR "aarch64")
33

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

build/cmake/aarch64-w64-mingw32.cmake

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
set(CMAKE_SYSTEM_NAME "Windows")
22
set(CMAKE_SYSTEM_PROCESSOR "aarch64")
33

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

9-
set(CMAKE_ADDR2LINE "/usr/bin/aarch64-w64-mingw32-addr2line")
10-
set(CMAKE_AR "/usr/bin/aarch64-w64-mingw32-ar")
11-
set(CMAKE_DLLTOOL "/usr/bin/aarch64-w64-mingw32-dlltool")
9+
set(CMAKE_ADDR2LINE "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-addr2line")
10+
set(CMAKE_AR "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-ar")
11+
set(CMAKE_DLLTOOL "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-dlltool")
1212
set(CMAKE_LINKER "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-ld")
13-
set(CMAKE_NM "/usr/bin/aarch64-w64-mingw32-nm")
14-
set(CMAKE_OBJCOPY "/usr/bin/aarch64-w64-mingw32-objcopy")
15-
set(CMAKE_OBJDUMP "/usr/bin/aarch64-w64-mingw32-objdump")
16-
set(CMAKE_RANLIB "/usr/bin/aarch64-w64-mingw32-ranlib")
17-
set(CMAKE_READELF "/usr/bin/aarch64-w64-mingw32-readelf")
18-
set(CMAKE_STRIP "/usr/bin/aarch64-w64-mingw32-strip")
13+
set(CMAKE_NM "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-nm")
14+
set(CMAKE_OBJCOPY "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-objcopy")
15+
set(CMAKE_OBJDUMP "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-objdump")
16+
set(CMAKE_RANLIB "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-ranlib")
17+
set(CMAKE_READELF "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-readelf")
18+
set(CMAKE_STRIP "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-strip")
1919

2020
set(CMAKE_FIND_ROOT_PATH "/opt/llvm-mingw-msvcrt/aarch64-w64-mingw32")
2121
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)

build/cmake/arm-linux-gnueabihf.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
set(CMAKE_SYSTEM_NAME "Linux")
22
set(CMAKE_SYSTEM_PROCESSOR "armv7l")
33

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

build/cmake/fudge.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
# Origignal script from https://github.com/ziglang/zig/issues/4911
4+
# Modified to add SILKDOTNET_ paths in response to some issues with SwiftShader
5+
6+
args=""
7+
for arg in "$@"
8+
do
9+
parg="$arg"
10+
11+
option=${arg%=*}
12+
target=${arg#*=}
13+
if [[ $option == "-march" || $option == "-mcpu" || $option == "-mtune" ]]; then
14+
moveon=0
15+
for replace in $SILKDOTNET_ReplaceArchitectureZigCcFlags
16+
do
17+
replacetarget=${replace%=*}
18+
replacement=${replace#*=}
19+
# echo $replacetarget A $replacement B $target END
20+
if [[ $replacetarget == $target ]]; then
21+
if [[ "$replacement" == "" ]]; then
22+
moveon=1
23+
else
24+
target="$replacement"
25+
fi
26+
fi
27+
done
28+
if [[ $moveon == 1 || "$SILKDOTNET_RemoveAllPotentiallyProblematicZigCcFlags" == "1" ]]; then
29+
continue
30+
else
31+
fixedTarget=${target//-/_}
32+
parg="$option=$fixedTarget"
33+
fi
34+
fi
35+
args="$args $parg"
36+
done

build/cmake/x86_64-linux-gnu.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
set(CMAKE_SYSTEM_NAME "Linux")
22
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
33

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

build/cmake/zig-ar.cmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
zig ar %*

build/cmake/zig-ar.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
zig ar "$@"

build/cmake/zig-c++.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
: TODO add -march/-mtune handling if necessary
3+
zig c++ %*

build/cmake/zig-c++.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
. "$(dirname ${BASH_SOURCE[0]})/fudge.sh" $args
3+
zig c++ $args

build/cmake/zig-cc.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
: TODO add -march/-mtune handling if necessary
3+
zig cc %*

build/cmake/zig-cc.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
. "$(dirname ${BASH_SOURCE[0]})/fudge.sh" $args
3+
zig cc $args

build/cmake/zig-ranlib.cmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
zig ranlib %*

build/cmake/zig-ranlib.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
zig ranlib "$@"

build/cmake/zig-rc.cmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
zig rc %*

build/cmake/zig-rc.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
zig rc "$@"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
set(ZIG_TARGET "aarch64-linux-gnu.2.17")
2+
include(${CMAKE_CURRENT_LIST_DIR}/zig-toolchain.cmake)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
set(ZIG_TARGET "arm-linux-gnueabihf.2.17")
2+
include(${CMAKE_CURRENT_LIST_DIR}/zig-toolchain.cmake)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
set(ZIG_TARGET "x86_64-linux-gnu.2.17")
2+
include(${CMAKE_CURRENT_LIST_DIR}/zig-toolchain.cmake)

build/cmake/zig-toolchain.cmake

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
include_guard()
2+
3+
if(CMAKE_GENERATOR MATCHES "Visual Studio")
4+
message(FATAL_ERROR "Visual Studio generator not supported, use: cmake -G Ninja")
5+
endif()
6+
7+
if(NOT ZIG_TARGET MATCHES "^([a-zZ-Z0-9_]+)-([a-zZ-Z0-9_]+)-([a-zZ-Z0-9_.]+)$")
8+
message(FATAL_ERROR "Expected -DZIG_TARGET=<arch>-<os>-<abi>")
9+
endif()
10+
11+
set(ZIG_ARCH ${CMAKE_MATCH_1})
12+
set(ZIG_OS ${CMAKE_MATCH_2})
13+
set(ZIG_ABI ${CMAKE_MATCH_3})
14+
15+
if(ZIG_OS STREQUAL "linux")
16+
set(CMAKE_SYSTEM_NAME "Linux")
17+
elseif(ZIG_OS STREQUAL "windows")
18+
set(CMAKE_SYSTEM_NAME "Windows")
19+
elseif(ZIG_OS STREQUAL "macos")
20+
set(CMAKE_SYSTEM_NAME "Darwin")
21+
else()
22+
message(WARNING "Unknown OS: ${ZIG_OS}")
23+
endif()
24+
25+
set(CMAKE_SYSTEM_VERSION 1)
26+
set(CMAKE_SYSTEM_PROCESSOR ${ZIG_ARCH})
27+
28+
if(WIN32)
29+
set(SCRIPT_SUFFIX ".cmd")
30+
else()
31+
set(SCRIPT_SUFFIX ".sh")
32+
endif()
33+
34+
# This is working (thanks to Simon for finding this trick)
35+
set(CMAKE_AR "${CMAKE_CURRENT_LIST_DIR}/zig-ar${SCRIPT_SUFFIX}")
36+
set(CMAKE_RANLIB "${CMAKE_CURRENT_LIST_DIR}/zig-ranlib${SCRIPT_SUFFIX}")
37+
set(CMAKE_RC_COMPILER "${CMAKE_CURRENT_LIST_DIR}/zig-rc${SCRIPT_SUFFIX}")
38+
set(CMAKE_ASM_COMPILER "${CMAKE_CURRENT_LIST_DIR}/zig-cc${SCRIPT_SUFFIX}" -target ${ZIG_TARGET})
39+
set(CMAKE_C_COMPILER "${CMAKE_CURRENT_LIST_DIR}/zig-cc${SCRIPT_SUFFIX}" -target ${ZIG_TARGET})
40+
set(CMAKE_CXX_COMPILER "${CMAKE_CURRENT_LIST_DIR}/zig-c++${SCRIPT_SUFFIX}" -target ${ZIG_TARGET})

build/nuke/Build.Generation.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ partial class Build
2424
Target RegenerateBindings => CommonTarget
2525
(
2626
x => x.After(Clean)
27-
.DependsOn(Restore)
2827
.Executes
2928
(
3029
() =>

0 commit comments

Comments
 (0)