Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
02d382c
Start of OpenAL bindings
Perksey Jul 6, 2025
8d44a2e
Use new al.xml
Perksey Sep 29, 2025
d88f2cd
Generate OpenAL bindings using al.xml
Perksey Sep 30, 2025
9fabb63
Add missing EFX bindings
Perksey Oct 5, 2025
cd41fe8
Add support for multiple global prefix hints
Perksey Oct 11, 2025
996ac5b
Enable data type trimming for the direct functions
Perksey Oct 11, 2025
3bf4842
Update OpenAL Soft
Perksey Oct 11, 2025
42b2e44
Add native binary build scripts
Perksey Oct 13, 2025
ab77310
Fix build errors (1)
Perksey Oct 13, 2025
b416356
Adjust build scripts
Perksey Oct 13, 2025
6820232
Disable fail fast
Perksey Oct 13, 2025
f8d85db
Add missing packages (this isn't the only thing to fix)
Perksey Oct 14, 2025
8f30049
Split dependency installation and building steps
Perksey Oct 14, 2025
4e25a3d
Helps if I commit the workflow changes
Perksey Oct 14, 2025
64dc196
Fix zig PATH issue
Perksey Oct 14, 2025
5923787
cry
Perksey Oct 14, 2025
98e2fc0
Revert
Perksey Oct 14, 2025
df3856d
Add sysroot parameters to Zig CMake toolchain
Perksey Oct 19, 2025
d386cdb
Use docker for the Linux builds
Perksey Oct 19, 2025
ad20577
Add missing deps, fix CMake lib/include paths, etc
Perksey Oct 20, 2025
9bc4c9b
Give up on Zig, use the GCC cross-compilers from apt
Perksey Oct 25, 2025
ae5ba65
Oops, add sudo back
Perksey Oct 25, 2025
784f7ff
Revert change that leads CI to build twice
Perksey Oct 25, 2025
747c966
Update native binaries for 784f7ffdff38960aa35eedc8e39d31023bfad599
dotnet-bot Oct 25, 2025
f15e53d
Update native binaries for 747c96644cc1550a9680c33bbfb709505ef7a315
dotnet-bot Oct 25, 2025
6146478
Fix GL-style type determination edge case, ALCEnum now generating
Perksey Nov 8, 2025
ad0f5ad
Implement Create and the contexts
Perksey Nov 9, 2025
52817a4
Merge branch 'feature/openal-bindings-3.0' of https://github.com/dotn…
Perksey Nov 9, 2025
e5eae02
Update native binaries for 52817a4323c3c89b33a3493fe7a81983ad68bd19
dotnet-bot Nov 9, 2025
6230167
Working OpenAL example!
Perksey Nov 10, 2025
e6b4486
Merge branch 'feature/openal-bindings-3.0' of https://github.com/dotn…
Perksey Nov 10, 2025
0a98aaf
Update native binaries for e6b44868e67f4738f5003d6b7c1ecd5834931762
dotnet-bot Nov 10, 2025
a35b3a9
Update native binaries for 0a98aaf2975e7442ecd00aa836534dfbde14e4bb
dotnet-bot Nov 10, 2025
42c1e84
Update native binaries for a35b3a9807befbe69a4e312516b1f2118404d8ab
dotnet-bot Nov 10, 2025
1bb69d1
Self-review fixes
Perksey Nov 11, 2025
1d86fb0
Merge branch 'feature/openal-bindings-3.0' of https://github.com/dotn…
Perksey Nov 11, 2025
47b1656
Add native licenses
Perksey Nov 11, 2025
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
  •  
  •  
  •  
10 changes: 6 additions & 4 deletions .github/workflows/native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ permissions:
contents: write
env:
# A space-separated list of paths to native libraries to build.
NATIVE_LIBRARY_PATHS: "sources/SDL/Native"
NATIVE_LIBRARY_PATHS: "sources/SDL/Native sources/OpenAL/Soft.Native"
# A space-separated list of submodule paths for each native library path. Use _ if a submodule is not used - this must
# match the number of spaces in NATIVE_LIBRARY_PATHS.
NATIVE_LIBRARY_SUBMODULE_PATHS: "eng/submodules/sdl"
NATIVE_LIBRARY_SUBMODULE_PATHS: "eng/submodules/sdl eng/submodules/openal-soft"
# A space-separated list of shorthands to the native library paths that will build the native library for each native
# library path. This must match the number of spaces in NATIVE_LIBRARY_PATHS. If a shorthand builds multiple native
# binary paths, these will be deduplicated.
NATIVE_LIBRARY_SHORTHANDS: "SDL"
NATIVE_LIBRARY_SHORTHANDS: "SDL OpenAL-Soft"
jobs:
prerequisites:
name: PR Check
Expand Down Expand Up @@ -61,13 +61,15 @@ jobs:
build:
needs: [prerequisites]
strategy:
fail-fast: false
matrix:
flat: ${{ fromJSON(needs.prerequisites.outputs.matrix_strategy) }}
runs-on: ${{ (startsWith(matrix.flat.runtime, 'osx') || startsWith(matrix.flat.runtime, 'ios') || startsWith(matrix.flat.runtime, 'tvos')) && 'macos-latest' || startsWith(matrix.flat.runtime, 'win') && 'windows-latest' || 'ubuntu-latest' }}
name: ${{ matrix.flat.target }} / ${{ matrix.flat.runtime }}
steps:
- uses: actions/checkout@v3
- run: |
- name: Build
run: |
echo "https://github.com/actions/upload-artifact/issues/174" > .workaround-${{ matrix.flat.target }}-${{ matrix.flat.runtime }}.txt
${{ format('.{0}{1}', startsWith(matrix.flat.runtime, 'win') && '\' || '/', matrix.flat.exec) }}
working-directory: ${{ matrix.flat.dir }}
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
[submodule "eng/submodules/silk.net-2.x"]
path = eng/submodules/silk.net-2.x
url = https://github.com/dotnet/Silk.NET
[submodule "eng/submodules/openal-soft"]
path = eng/submodules/openal-soft
url = https://github.com/kcat/openal-soft
3 changes: 3 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,7 @@
</ItemGroup>
<Copy SourceFiles="@(SilkThisRidItems)" DestinationFiles="@(SilkThisRidItems->'$(OutDir)%(TargetPath)')" />
</Target>

<!-- DSL dogfooding -->
<Import Project="$(MSBuildThisFileDirectory)sources/Core/Core/Silk.NET.Core.targets" Condition="'$(SilkDSLExempt)' != 'true' and '$(SilkNativePackage)' != 'true' and '$(SilkMetapackage)' != 'true'" />
</Project>
9 changes: 2 additions & 7 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,20 @@
<PackageVersion Include="DotNet.ReproducibleBuilds.Isolated" Version="1.1.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="NAudio.Core" Version="2.2.1" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageVersion Include="NUnit.Analyzers" Version="4.4.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="NUnit" Version="4.2.2" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />

<!-- eng/benchmarks -->
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />

<!-- Silk.NET.Core -->
<PackageVersion Include="Fody" Version="6.8.2" PrivateAssets="all" />
<PackageVersion Include="InlineIL.Fody" Version="1.9.0" PrivateAssets="all" />

<!-- Analyzers -->
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />

<!-- SilkTouch -->
<PackageVersion Include="ClangSharp.PInvokeGenerator" Version="18.1.0.2" />
<PackageVersion Include="CSharpier.Core" Version="0.30.2" />
Expand All @@ -39,14 +36,12 @@
<PackageVersion Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.12.2149" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageVersion Include="System.IO.Hashing" Version="9.0.0" />

<!-- This is not used but it is used transitively and the version pulled in has a vulnerability -->
<PackageVersion Include="System.Formats.Asn1" Version="9.0.0" />

<!-- SilkTouch Unit Tests -->
<PackageVersion Include="Silk.NET.BuildTools" Version="2.22.0" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="Verify.DiffPlex" Version="3.1.2" />
<PackageVersion Include="Verify.NUnit" Version="28.3.2" />
</ItemGroup>
</Project>
</Project>
25 changes: 25 additions & 0 deletions Silk.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Windowing", "Windowing", "{
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Windowing", "sources\Windowing\Windowing\Silk.NET.Windowing.csproj", "{EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenAL", "OpenAL", "{AF13F7C9-4EE2-403E-B3D2-C4C2E45D9EF3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.OpenAL", "sources\OpenAL\OpenAL\Silk.NET.OpenAL.csproj", "{1FFFDD72-D023-441C-AF49-F1EA78FF7DE9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{6077EDD4-F16F-4CA4-B72E-E4627D64B104}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CSharp", "CSharp", "{12B4D1CB-8938-4EC4-8895-79C4E6ABD1E8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenAL", "OpenAL", "{662A1AEC-91F2-48FA-AA29-6F27038D30F2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tutorial001.HelloSound", "examples\CSharp\OpenAL\Tutorial001.HelloSound\Tutorial001.HelloSound.csproj", "{946C912C-5BBB-446A-A566-0D1696D19F59}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -168,6 +180,14 @@ Global
{EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E}.Release|Any CPU.Build.0 = Release|Any CPU
{1FFFDD72-D023-441C-AF49-F1EA78FF7DE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1FFFDD72-D023-441C-AF49-F1EA78FF7DE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1FFFDD72-D023-441C-AF49-F1EA78FF7DE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1FFFDD72-D023-441C-AF49-F1EA78FF7DE9}.Release|Any CPU.Build.0 = Release|Any CPU
{946C912C-5BBB-446A-A566-0D1696D19F59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{946C912C-5BBB-446A-A566-0D1696D19F59}.Debug|Any CPU.Build.0 = Debug|Any CPU
{946C912C-5BBB-446A-A566-0D1696D19F59}.Release|Any CPU.ActiveCfg = Release|Any CPU
{946C912C-5BBB-446A-A566-0D1696D19F59}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -200,6 +220,11 @@ Global
{F16C0AB9-DE7E-4C09-9EE9-DAA8B8E935A6} = {EC4D7B06-D277-4411-BD7B-71A6D37683F0}
{FE4414F8-5370-445D-9F24-C3AD3223F299} = {DD29EA8F-B1A6-45AA-8D2E-B38DA56D9EF6}
{EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E} = {FE4414F8-5370-445D-9F24-C3AD3223F299}
{AF13F7C9-4EE2-403E-B3D2-C4C2E45D9EF3} = {DD29EA8F-B1A6-45AA-8D2E-B38DA56D9EF6}
{1FFFDD72-D023-441C-AF49-F1EA78FF7DE9} = {AF13F7C9-4EE2-403E-B3D2-C4C2E45D9EF3}
{12B4D1CB-8938-4EC4-8895-79C4E6ABD1E8} = {6077EDD4-F16F-4CA4-B72E-E4627D64B104}
{662A1AEC-91F2-48FA-AA29-6F27038D30F2} = {12B4D1CB-8938-4EC4-8895-79C4E6ABD1E8}
{946C912C-5BBB-446A-A566-0D1696D19F59} = {662A1AEC-91F2-48FA-AA29-6F27038D30F2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {78D2CF6A-60A1-43E3-837B-00B73C9DA384}
Expand Down
131 changes: 131 additions & 0 deletions docs/silk.net/static-vs-instance-bindings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Static vs Input Bindings

## Overview

Silk.NET has multiple ways to access the underlying APIs, either through a static method (e.g. `GL.GenBuffers`) or
through an "API object" (e.g. created with `GL.Create` and then accessed as `gl.GenBuffers`). Not all APIs are the
same, and some are better accessed through one method or the other. Note that Silk.NET does make both available however,
so if you're prefer consistency feel free to pick one method and stick to it, though you may result in some minor
inefficiencies.

All native APIs are accessed using a "function pointer" - a location in memory at which the native code resides.
This is typically fetched using `DllImport`, but some APIs require custom mechanisms. An example in OpenGL, where you
must use a "context API" (e.g. WGL, GLX, EGL, etc) to create a context and, after setting up that context state, use a
function provided by that context API to get the function pointers for OpenGL (e.g. `wglGetProcAddress`). We refer to
these as "stateful APIs" in this document. Note that OpenGL is not the only stateful API, this will be elaborated later.

Stateless APIs are those where the function pointers aren't contingent on any other state, and they're effectively
accessed as if they were static functions. For these, the function pointers are typically retrieved through `DllImport`,
but this needn't preclude other APIs from having bespoke mechanisms to statelessly retrieve function pointers (though,
there are no examples of this today).

When using a stateful API, you should use API objects if possible i.e. `API.Create`, and dispose of that object when you
are done using that API. When using a stateless API, you should use the static functions exposed directly on the API
class.

> [!NOTE]
> Future releases of Silk.NET are intended to contain analysers to indicate the correct access method.

Below is a description of the stateful APIs. All other APIs not listed here are, or can be treated as, stateless.

## OpenGL

OpenGL is a stateful API because it requires a context to be created and "made current" on that thread before function
pointers can be retrieved. Typically, this context is created using Silk.NET.Windowing, and the functions would be
retrieved using `surface.OpenGL.GetProcAddress` in that example.

To create an API object, our OpenGL bindings provide a utility function `CreateOpenGL`:
```csharp
IGL gl = null!;
surface.Created += _ =>
{
gl = surface.CreateOpenGL();
// Use gl functions here...
gl.Flush();
}
surface.Render += _ =>
{
// Use gl functions here...
gl.Clear(ClearBufferMask.ColorBufferBit);
}
```

If you'd prefer to use static methods despite OpenGL being stateful, the static functions on `GL` will forward to
`GL.ThisThread`, which essentially forwards to a thread-specific `IGL` instance. You can change the `IGL` instance used
by a thread using `GL.ThisThread.MakeCurrent`, which will also implicitly make the `IGLContext` you pass it current
(if applicable). Note that Silk.NET.Windowing will implicitly call this, so you can use the static OpenGL functions in
the obvious way, albeit with the implied indirection through `GL.ThisThread`:
```csharp
surface.Created += _ =>
{
GL.Flush();
}
surface.Render += _ =>
{
GL.Clear(ClearBufferMask.ColorBufferBit);
}
```

> [!CAUTION]
> TODO: Silk.NET.Windowing does not currently do this! `surface.MakeCurrent()` must be used in `surface.Created` to make
> this happen.

## Vulkan

Vulkan is a stateful API because its function pointers are dependent on the `InstanceHandle` and `DeviceHandle` being
used. Our Vulkan bindings intercept calls to `Vk.CreateInstance` and `Vk.CreateDevice`, and set `CurrentInstance` and
`CurrentDevice` respectively on the Vulkan API object for later use with `Vk.GetDeviceProcAddr` and
`Vk.GetInstanceProcAddr`.

The Vulkan API object will first try `vkGetDeviceProcAddr` to load a function pointer (where the value for `device` is
as in `CurrentDevice`), followed by `vkGetInstanceProcAddr` (where the value for `instance` is as in `CurrentInstance`).
For `vkGetInstanceProcAddr` itself, `DllImport` is used.

`CurrentInstance` is set upon a successful call to `vkCreateInstance`, and `CurrentDevice` is set upon a successful call
to `vkCreateDevice`. Note that it is illegal to change these values on an API object if they're already set, if you have
scenarios requiring multiple instance-device combinations you must create multiple API objects.

> [!TIP]
> In cases where you have one instance from which multiple devices are created, simply clone the `IVk` object using
> `IVk.Clone()` prior to **any device** being created. This will reuse the function pointers already loaded for that
> instance.

If you'd prefer to use static methods despite Vulkan being stateful, the static functions on `Vk` will forward to
`Vk.ThisThread`, which essentially forwards to a thread-specific `IVk` instance. You can change the `IVk` instance used
by a thread using `Vk.ThisThread.MakeCurrent`. The static functions, much like using a single `IVk` instance, will throw
if multiple instance-device combinations are used on the same thread without changing the `IVk` object being used.

## OpenXR

OpenXR has the same caveats as Vulkan but with `CurrentInstance` only.

## OpenAL

OpenAL has the same caveats as OpenGL, with the exception that `alGetProcAddress` is made available to retrieve the
function pointers. This still has the requirement of a thread-specific context, however, which can be made current using
`AL.ThisThread.MakeCurrent`.

Unlike OpenGL, OpenAL has an official context API: OpenAL Context (ALC). `alcMakeContextCurrent` will implicitly call
`AL.ThisThread.MakeCurrent` meaning that the static OpenAL functions are made available in the obvious way:

```csharp
// NOTE: We are making use of ALContext's static functions here as well.
// The same applies as if `ALContext.Create` were used.
DeviceHandle device = ALContext.OpenDevice("");
if (device == nullptr) throw new("failed to create device");

ContextHandle context = ALContext.CreateContext(device, nullptr);
if (context == nullptr) throw new("failed to create context");

// Now make the context current. This implicitly calls AL.ThisThread.MakeCurrent
ALContext.MakeContextCurrent(context);

// Static functions now just work.
var source = AL.GenSource();
```

## OpenAL Context (ALContext/ALC)

ALC has the same caveats as Vulkan, given that the ALC function pointers are tied to a specific device. As a result,
`alcOpenDevice` is intercepted to set the value of `CurrentDevice` to then be fed into `alcGetProcAddress` (or
`alcGetProcAddress2` if available).
26 changes: 26 additions & 0 deletions eng/native/cmake/aarch64-linux-gnu.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "aarch64")

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++")

set(CMAKE_ADDR2LINE "/usr/bin/aarch64-linux-gnu-addr2line")
set(CMAKE_AR "/usr/bin/aarch64-linux-gnu-ar")
set(CMAKE_LINKER "/usr/bin/aarch64-linux-gnu-ld")
set(CMAKE_NM "/usr/bin/aarch64-linux-gnu-nm")
set(CMAKE_OBJCOPY "/usr/bin/aarch64-linux-gnu-objcopy")
set(CMAKE_OBJDUMP "/usr/bin/aarch64-linux-gnu-objdump")
set(CMAKE_RANLIB "/usr/bin/aarch64-linux-gnu-ranlib")
set(CMAKE_READELF "/usr/bin/aarch64-linux-gnu-readelf")
set(CMAKE_STRIP "/usr/bin/aarch64-linux-gnu-strip")

set(PKG_CONFIG_EXECUTABLE "/usr/bin/pkg-config")
set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/aarch64-linux-gnu/pkgconfig")
set(ENV{PKG_CONFIG_PATH} "/usr/lib/pkgconfig:/usr/share/pkgconfig")

set(CMAKE_FIND_ROOT_PATH "/usr/aarch64-linux-gnu")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)
24 changes: 24 additions & 0 deletions eng/native/cmake/aarch64-w64-mingw32.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
set(CMAKE_SYSTEM_NAME "Windows")
set(CMAKE_SYSTEM_PROCESSOR "aarch64")

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 "/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 "/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)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
26 changes: 26 additions & 0 deletions eng/native/cmake/arm-linux-gnueabihf.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "armv7l")

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++")

set(CMAKE_ADDR2LINE "/usr/bin/arm-linux-gnueabihf-addr2line")
set(CMAKE_AR "/usr/bin/arm-linux-gnueabihf-ar")
set(CMAKE_LINKER "/usr/bin/arm-linux-gnueabihf-ld")
set(CMAKE_NM "/usr/bin/arm-linux-gnueabihf-nm")
set(CMAKE_OBJCOPY "/usr/bin/arm-linux-gnueabihf-objcopy")
set(CMAKE_OBJDUMP "/usr/bin/arm-linux-gnueabihf-objdump")
set(CMAKE_RANLIB "/usr/bin/arm-linux-gnueabihf-ranlib")
set(CMAKE_READELF "/usr/bin/arm-linux-gnueabihf-readelf")
set(CMAKE_STRIP "/usr/bin/arm-linux-gnueabihf-strip")

set(PKG_CONFIG_EXECUTABLE "/usr/bin/pkg-config")
set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/arm-linux-gnueabihf/pkgconfig")
set(ENV{PKG_CONFIG_PATH} "/usr/lib/pkgconfig:/usr/share/pkgconfig")

set(CMAKE_FIND_ROOT_PATH "/usr/arm-linux-gnueabihf")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)
26 changes: 26 additions & 0 deletions eng/native/cmake/x86_64-linux-gnu.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "x86_64")

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++")

set(CMAKE_ADDR2LINE "/usr/bin/x86_64-linux-gnu-addr2line")
set(CMAKE_AR "/usr/bin/x86_64-linux-gnu-ar")
set(CMAKE_LINKER "/usr/bin/x86_64-linux-gnu-ld")
set(CMAKE_NM "/usr/bin/x86_64-linux-gnu-nm")
set(CMAKE_OBJCOPY "/usr/bin/x86_64-linux-gnu-objcopy")
set(CMAKE_OBJDUMP "/usr/bin/x86_64-linux-gnu-objdump")
set(CMAKE_RANLIB "/usr/bin/x86_64-linux-gnu-ranlib")
set(CMAKE_READELF "/usr/bin/x86_64-linux-gnu-readelf")
set(CMAKE_STRIP "/usr/bin/x86_64-linux-gnu-strip")

set(PKG_CONFIG_EXECUTABLE "/usr/bin/pkg-config")
set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/x86_64-linux-gnu/pkgconfig")
set(ENV{PKG_CONFIG_PATH} "/usr/lib/pkgconfig:/usr/share/pkgconfig")

set(CMAKE_FIND_ROOT_PATH "/usr/x86_64-linux-gnu")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)
2 changes: 2 additions & 0 deletions eng/native/cmake/zig-objcopy.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
zig objcopy %*
2 changes: 2 additions & 0 deletions eng/native/cmake/zig-objcopy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
zig objcopy "$@"
2 changes: 2 additions & 0 deletions eng/native/cmake/zig-toolchain-aarch64-linux-gnu.2.28.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set(ZIG_TARGET "aarch64-linux-gnu.2.28")
include(${CMAKE_CURRENT_LIST_DIR}/zig-toolchain.cmake)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set(ZIG_TARGET "arm-linux-gnueabihf.2.28")
include(${CMAKE_CURRENT_LIST_DIR}/zig-toolchain.cmake)
2 changes: 2 additions & 0 deletions eng/native/cmake/zig-toolchain-x86_64-linux-gnu.2.28.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set(ZIG_TARGET "x86_64-linux-gnu.2.28")
include(${CMAKE_CURRENT_LIST_DIR}/zig-toolchain.cmake)
Loading
Loading