Skip to content

Commit 27afc20

Browse files
Perkseydotnet-bot
andauthored
[3.0] OpenAL Bindings (#2494)
* Start of OpenAL bindings * Use new al.xml * Generate OpenAL bindings using al.xml * Add missing EFX bindings * Add support for multiple global prefix hints * Enable data type trimming for the direct functions * Update OpenAL Soft * Add native binary build scripts * Fix build errors (1) * Adjust build scripts * Disable fail fast * Add missing packages (this isn't the only thing to fix) * Split dependency installation and building steps * Helps if I commit the workflow changes * Fix zig PATH issue * cry * Revert * Add sysroot parameters to Zig CMake toolchain * Use docker for the Linux builds * Add missing deps, fix CMake lib/include paths, etc * Give up on Zig, use the GCC cross-compilers from apt * Oops, add sudo back * Revert change that leads CI to build twice * Update native binaries for 784f7ff * Update native binaries for 747c966 * Fix GL-style type determination edge case, ALCEnum now generating * Implement Create and the contexts * Update native binaries for 52817a4 * Working OpenAL example! * Update native binaries for e6b4486 * Update native binaries for 0a98aaf * Update native binaries for a35b3a9 * Self-review fixes * Add native licenses * Make the benchmarks DSL exempt * Update OpenAL submodule * Make CurrentDevice being set to the same value a no-op * cont'd * Update native binaries for 4facef6 * Update native binaries for 7a6d944 * Update native binaries for 07c5176 --------- Co-authored-by: The Silk.NET Automaton <[email protected]>
1 parent 3c5e21d commit 27afc20

File tree

527 files changed

+90497
-16975
lines changed

Some content is hidden

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

527 files changed

+90497
-16975
lines changed

.github/workflows/native.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ permissions:
77
contents: write
88
env:
99
# A space-separated list of paths to native libraries to build.
10-
NATIVE_LIBRARY_PATHS: "sources/SDL/Native"
10+
NATIVE_LIBRARY_PATHS: "sources/SDL/Native sources/OpenAL/Soft.Native"
1111
# A space-separated list of submodule paths for each native library path. Use _ if a submodule is not used - this must
1212
# match the number of spaces in NATIVE_LIBRARY_PATHS.
13-
NATIVE_LIBRARY_SUBMODULE_PATHS: "eng/submodules/sdl"
13+
NATIVE_LIBRARY_SUBMODULE_PATHS: "eng/submodules/sdl eng/submodules/openal-soft"
1414
# A space-separated list of shorthands to the native library paths that will build the native library for each native
1515
# library path. This must match the number of spaces in NATIVE_LIBRARY_PATHS. If a shorthand builds multiple native
1616
# binary paths, these will be deduplicated.
17-
NATIVE_LIBRARY_SHORTHANDS: "SDL"
17+
NATIVE_LIBRARY_SHORTHANDS: "SDL OpenAL-Soft"
1818
jobs:
1919
prerequisites:
2020
name: PR Check
@@ -61,13 +61,15 @@ jobs:
6161
build:
6262
needs: [prerequisites]
6363
strategy:
64+
fail-fast: false
6465
matrix:
6566
flat: ${{ fromJSON(needs.prerequisites.outputs.matrix_strategy) }}
6667
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' }}
6768
name: ${{ matrix.flat.target }} / ${{ matrix.flat.runtime }}
6869
steps:
6970
- uses: actions/checkout@v3
70-
- run: |
71+
- name: Build
72+
run: |
7173
echo "https://github.com/actions/upload-artifact/issues/174" > .workaround-${{ matrix.flat.target }}-${{ matrix.flat.runtime }}.txt
7274
${{ format('.{0}{1}', startsWith(matrix.flat.runtime, 'win') && '\' || '/', matrix.flat.exec) }}
7375
working-directory: ${{ matrix.flat.dir }}

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@
1313
[submodule "eng/submodules/silk.net-2.x"]
1414
path = eng/submodules/silk.net-2.x
1515
url = https://github.com/dotnet/Silk.NET
16+
[submodule "eng/submodules/openal-soft"]
17+
path = eng/submodules/openal-soft
18+
url = https://github.com/kcat/openal-soft

Directory.Build.targets

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,4 +270,7 @@
270270
</ItemGroup>
271271
<Copy SourceFiles="@(SilkThisRidItems)" DestinationFiles="@(SilkThisRidItems->'$(OutDir)%(TargetPath)')" />
272272
</Target>
273+
274+
<!-- DSL dogfooding -->
275+
<Import Project="$(MSBuildThisFileDirectory)sources/Core/Core/Silk.NET.Core.targets" Condition="'$(SilkDSLExempt)' != 'true' and '$(SilkNativePackage)' != 'true' and '$(SilkMetapackage)' != 'true'" />
273276
</Project>

Directory.Packages.props

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,20 @@
55
<PackageVersion Include="DotNet.ReproducibleBuilds.Isolated" Version="1.1.1" />
66
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" />
77
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
8+
<PackageVersion Include="NAudio.Core" Version="2.2.1" />
89
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
910
<PackageVersion Include="NUnit.Analyzers" Version="4.4.0" />
1011
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
1112
<PackageVersion Include="NUnit" Version="4.2.2" />
1213
<PackageVersion Include="xunit" Version="2.9.2" />
1314
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
14-
1515
<!-- eng/benchmarks -->
1616
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
17-
1817
<!-- Silk.NET.Core -->
1918
<PackageVersion Include="Fody" Version="6.8.2" PrivateAssets="all" />
2019
<PackageVersion Include="InlineIL.Fody" Version="1.9.0" PrivateAssets="all" />
21-
2220
<!-- Analyzers -->
2321
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
24-
2522
<!-- SilkTouch -->
2623
<PackageVersion Include="ClangSharp.PInvokeGenerator" Version="18.1.0.2" />
2724
<PackageVersion Include="CSharpier.Core" Version="0.30.2" />
@@ -39,14 +36,12 @@
3936
<PackageVersion Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.12.2149" />
4037
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
4138
<PackageVersion Include="System.IO.Hashing" Version="9.0.0" />
42-
4339
<!-- This is not used but it is used transitively and the version pulled in has a vulnerability -->
4440
<PackageVersion Include="System.Formats.Asn1" Version="9.0.0" />
45-
4641
<!-- SilkTouch Unit Tests -->
4742
<PackageVersion Include="Silk.NET.BuildTools" Version="2.22.0" />
4843
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
4944
<PackageVersion Include="Verify.DiffPlex" Version="3.1.2" />
5045
<PackageVersion Include="Verify.NUnit" Version="28.3.2" />
5146
</ItemGroup>
52-
</Project>
47+
</Project>

Silk.NET.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Windowing", "Windowing", "{
102102
EndProject
103103
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Windowing", "sources\Windowing\Windowing\Silk.NET.Windowing.csproj", "{EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E}"
104104
EndProject
105+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenAL", "OpenAL", "{AF13F7C9-4EE2-403E-B3D2-C4C2E45D9EF3}"
106+
EndProject
107+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.OpenAL", "sources\OpenAL\OpenAL\Silk.NET.OpenAL.csproj", "{1FFFDD72-D023-441C-AF49-F1EA78FF7DE9}"
108+
EndProject
109+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{6077EDD4-F16F-4CA4-B72E-E4627D64B104}"
110+
EndProject
111+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CSharp", "CSharp", "{12B4D1CB-8938-4EC4-8895-79C4E6ABD1E8}"
112+
EndProject
113+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenAL", "OpenAL", "{662A1AEC-91F2-48FA-AA29-6F27038D30F2}"
114+
EndProject
115+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tutorial001.HelloSound", "examples\CSharp\OpenAL\Tutorial001.HelloSound\Tutorial001.HelloSound.csproj", "{946C912C-5BBB-446A-A566-0D1696D19F59}"
116+
EndProject
105117
Global
106118
GlobalSection(SolutionConfigurationPlatforms) = preSolution
107119
Debug|Any CPU = Debug|Any CPU
@@ -168,6 +180,14 @@ Global
168180
{EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
169181
{EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
170182
{EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E}.Release|Any CPU.Build.0 = Release|Any CPU
183+
{1FFFDD72-D023-441C-AF49-F1EA78FF7DE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
184+
{1FFFDD72-D023-441C-AF49-F1EA78FF7DE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
185+
{1FFFDD72-D023-441C-AF49-F1EA78FF7DE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
186+
{1FFFDD72-D023-441C-AF49-F1EA78FF7DE9}.Release|Any CPU.Build.0 = Release|Any CPU
187+
{946C912C-5BBB-446A-A566-0D1696D19F59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
188+
{946C912C-5BBB-446A-A566-0D1696D19F59}.Debug|Any CPU.Build.0 = Debug|Any CPU
189+
{946C912C-5BBB-446A-A566-0D1696D19F59}.Release|Any CPU.ActiveCfg = Release|Any CPU
190+
{946C912C-5BBB-446A-A566-0D1696D19F59}.Release|Any CPU.Build.0 = Release|Any CPU
171191
EndGlobalSection
172192
GlobalSection(SolutionProperties) = preSolution
173193
HideSolutionNode = FALSE
@@ -200,6 +220,11 @@ Global
200220
{F16C0AB9-DE7E-4C09-9EE9-DAA8B8E935A6} = {EC4D7B06-D277-4411-BD7B-71A6D37683F0}
201221
{FE4414F8-5370-445D-9F24-C3AD3223F299} = {DD29EA8F-B1A6-45AA-8D2E-B38DA56D9EF6}
202222
{EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E} = {FE4414F8-5370-445D-9F24-C3AD3223F299}
223+
{AF13F7C9-4EE2-403E-B3D2-C4C2E45D9EF3} = {DD29EA8F-B1A6-45AA-8D2E-B38DA56D9EF6}
224+
{1FFFDD72-D023-441C-AF49-F1EA78FF7DE9} = {AF13F7C9-4EE2-403E-B3D2-C4C2E45D9EF3}
225+
{12B4D1CB-8938-4EC4-8895-79C4E6ABD1E8} = {6077EDD4-F16F-4CA4-B72E-E4627D64B104}
226+
{662A1AEC-91F2-48FA-AA29-6F27038D30F2} = {12B4D1CB-8938-4EC4-8895-79C4E6ABD1E8}
227+
{946C912C-5BBB-446A-A566-0D1696D19F59} = {662A1AEC-91F2-48FA-AA29-6F27038D30F2}
203228
EndGlobalSection
204229
GlobalSection(ExtensibilityGlobals) = postSolution
205230
SolutionGuid = {78D2CF6A-60A1-43E3-837B-00B73C9DA384}
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Static vs Input Bindings
2+
3+
## Overview
4+
5+
Silk.NET has multiple ways to access the underlying APIs, either through a static method (e.g. `GL.GenBuffers`) or
6+
through an "API object" (e.g. created with `GL.Create` and then accessed as `gl.GenBuffers`). Not all APIs are the
7+
same, and some are better accessed through one method or the other. Note that Silk.NET does make both available however,
8+
so if you're prefer consistency feel free to pick one method and stick to it, though you may result in some minor
9+
inefficiencies.
10+
11+
All native APIs are accessed using a "function pointer" - a location in memory at which the native code resides.
12+
This is typically fetched using `DllImport`, but some APIs require custom mechanisms. An example in OpenGL, where you
13+
must use a "context API" (e.g. WGL, GLX, EGL, etc) to create a context and, after setting up that context state, use a
14+
function provided by that context API to get the function pointers for OpenGL (e.g. `wglGetProcAddress`). We refer to
15+
these as "stateful APIs" in this document. Note that OpenGL is not the only stateful API, this will be elaborated later.
16+
17+
Stateless APIs are those where the function pointers aren't contingent on any other state, and they're effectively
18+
accessed as if they were static functions. For these, the function pointers are typically retrieved through `DllImport`,
19+
but this needn't preclude other APIs from having bespoke mechanisms to statelessly retrieve function pointers (though,
20+
there are no examples of this today).
21+
22+
When using a stateful API, you should use API objects if possible i.e. `API.Create`, and dispose of that object when you
23+
are done using that API. When using a stateless API, you should use the static functions exposed directly on the API
24+
class.
25+
26+
> [!NOTE]
27+
> Future releases of Silk.NET are intended to contain analysers to indicate the correct access method.
28+
29+
Below is a description of the stateful APIs. All other APIs not listed here are, or can be treated as, stateless.
30+
31+
## OpenGL
32+
33+
OpenGL is a stateful API because it requires a context to be created and "made current" on that thread before function
34+
pointers can be retrieved. Typically, this context is created using Silk.NET.Windowing, and the functions would be
35+
retrieved using `surface.OpenGL.GetProcAddress` in that example.
36+
37+
To create an API object, our OpenGL bindings provide a utility function `CreateOpenGL`:
38+
```csharp
39+
IGL gl = null!;
40+
surface.Created += _ =>
41+
{
42+
gl = surface.CreateOpenGL();
43+
// Use gl functions here...
44+
gl.Flush();
45+
}
46+
surface.Render += _ =>
47+
{
48+
// Use gl functions here...
49+
gl.Clear(ClearBufferMask.ColorBufferBit);
50+
}
51+
```
52+
53+
If you'd prefer to use static methods despite OpenGL being stateful, the static functions on `GL` will forward to
54+
`GL.ThisThread`, which essentially forwards to a thread-specific `IGL` instance. You can change the `IGL` instance used
55+
by a thread using `GL.ThisThread.MakeCurrent`, which will also implicitly make the `IGLContext` you pass it current
56+
(if applicable). Note that Silk.NET.Windowing will implicitly call this, so you can use the static OpenGL functions in
57+
the obvious way, albeit with the implied indirection through `GL.ThisThread`:
58+
```csharp
59+
surface.Created += _ =>
60+
{
61+
GL.Flush();
62+
}
63+
surface.Render += _ =>
64+
{
65+
GL.Clear(ClearBufferMask.ColorBufferBit);
66+
}
67+
```
68+
69+
> [!CAUTION]
70+
> TODO: Silk.NET.Windowing does not currently do this! `surface.MakeCurrent()` must be used in `surface.Created` to make
71+
> this happen.
72+
73+
## Vulkan
74+
75+
Vulkan is a stateful API because its function pointers are dependent on the `InstanceHandle` and `DeviceHandle` being
76+
used. Our Vulkan bindings intercept calls to `Vk.CreateInstance` and `Vk.CreateDevice`, and set `CurrentInstance` and
77+
`CurrentDevice` respectively on the Vulkan API object for later use with `Vk.GetDeviceProcAddr` and
78+
`Vk.GetInstanceProcAddr`.
79+
80+
The Vulkan API object will first try `vkGetDeviceProcAddr` to load a function pointer (where the value for `device` is
81+
as in `CurrentDevice`), followed by `vkGetInstanceProcAddr` (where the value for `instance` is as in `CurrentInstance`).
82+
For `vkGetInstanceProcAddr` itself, `DllImport` is used.
83+
84+
`CurrentInstance` is set upon a successful call to `vkCreateInstance`, and `CurrentDevice` is set upon a successful call
85+
to `vkCreateDevice`. Note that it is illegal to change these values on an API object if they're already set, if you have
86+
scenarios requiring multiple instance-device combinations you must create multiple API objects.
87+
88+
> [!TIP]
89+
> In cases where you have one instance from which multiple devices are created, simply clone the `IVk` object using
90+
> `IVk.Clone()` prior to **any device** being created. This will reuse the function pointers already loaded for that
91+
> instance.
92+
93+
If you'd prefer to use static methods despite Vulkan being stateful, the static functions on `Vk` will forward to
94+
`Vk.ThisThread`, which essentially forwards to a thread-specific `IVk` instance. You can change the `IVk` instance used
95+
by a thread using `Vk.ThisThread.MakeCurrent`. The static functions, much like using a single `IVk` instance, will throw
96+
if multiple instance-device combinations are used on the same thread without changing the `IVk` object being used.
97+
98+
## OpenXR
99+
100+
OpenXR has the same caveats as Vulkan but with `CurrentInstance` only.
101+
102+
## OpenAL
103+
104+
OpenAL has the same caveats as OpenGL, with the exception that `alGetProcAddress` is made available to retrieve the
105+
function pointers. This still has the requirement of a thread-specific context, however, which can be made current using
106+
`AL.ThisThread.MakeCurrent`.
107+
108+
Unlike OpenGL, OpenAL has an official context API: OpenAL Context (ALC). `alcMakeContextCurrent` will implicitly call
109+
`AL.ThisThread.MakeCurrent` meaning that the static OpenAL functions are made available in the obvious way:
110+
111+
```csharp
112+
// NOTE: We are making use of ALContext's static functions here as well.
113+
// The same applies as if `ALContext.Create` were used.
114+
DeviceHandle device = ALContext.OpenDevice("");
115+
if (device == nullptr) throw new("failed to create device");
116+
117+
ContextHandle context = ALContext.CreateContext(device, nullptr);
118+
if (context == nullptr) throw new("failed to create context");
119+
120+
// Now make the context current. This implicitly calls AL.ThisThread.MakeCurrent
121+
ALContext.MakeContextCurrent(context);
122+
123+
// Static functions now just work.
124+
var source = AL.GenSource();
125+
```
126+
127+
## OpenAL Context (ALContext/ALC)
128+
129+
ALC has the same caveats as Vulkan, given that the ALC function pointers are tied to a specific device. As a result,
130+
`alcOpenDevice` is intercepted to set the value of `CurrentDevice` to then be fed into `alcGetProcAddress` (or
131+
`alcGetProcAddress2` if available).

eng/benchmarks/Silk.NET.Maths.Benchmarks/Silk.NET.Maths.Benchmarks.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net8.0</TargetFramework>
66
<DefineConstants>$(DefineConstants);MATHF</DefineConstants>
7+
<SilkDSLExempt>true</SilkDSLExempt>
78
</PropertyGroup>
89

910
<ItemGroup>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
set(CMAKE_SYSTEM_NAME "Linux")
2+
set(CMAKE_SYSTEM_PROCESSOR "aarch64")
3+
4+
set(CMAKE_ASM_COMPILER "/usr/bin/aarch64-linux-gnu-gcc")
5+
set(CMAKE_C_COMPILER "/usr/bin/aarch64-linux-gnu-gcc")
6+
set(CMAKE_CXX_COMPILER "/usr/bin/aarch64-linux-gnu-g++")
7+
8+
set(CMAKE_ADDR2LINE "/usr/bin/aarch64-linux-gnu-addr2line")
9+
set(CMAKE_AR "/usr/bin/aarch64-linux-gnu-ar")
10+
set(CMAKE_LINKER "/usr/bin/aarch64-linux-gnu-ld")
11+
set(CMAKE_NM "/usr/bin/aarch64-linux-gnu-nm")
12+
set(CMAKE_OBJCOPY "/usr/bin/aarch64-linux-gnu-objcopy")
13+
set(CMAKE_OBJDUMP "/usr/bin/aarch64-linux-gnu-objdump")
14+
set(CMAKE_RANLIB "/usr/bin/aarch64-linux-gnu-ranlib")
15+
set(CMAKE_READELF "/usr/bin/aarch64-linux-gnu-readelf")
16+
set(CMAKE_STRIP "/usr/bin/aarch64-linux-gnu-strip")
17+
18+
set(PKG_CONFIG_EXECUTABLE "/usr/bin/pkg-config")
19+
set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/aarch64-linux-gnu/pkgconfig")
20+
set(ENV{PKG_CONFIG_PATH} "/usr/lib/pkgconfig:/usr/share/pkgconfig")
21+
22+
set(CMAKE_FIND_ROOT_PATH "/usr/aarch64-linux-gnu")
23+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
24+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
25+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
26+
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
set(CMAKE_SYSTEM_NAME "Windows")
2+
set(CMAKE_SYSTEM_PROCESSOR "aarch64")
3+
4+
set(CMAKE_ASM_COMPILER "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-gcc")
5+
set(CMAKE_C_COMPILER "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-gcc")
6+
set(CMAKE_CXX_COMPILER "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-g++")
7+
set(CMAKE_RC_COMPILER "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-windres")
8+
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")
12+
set(CMAKE_LINKER "/opt/llvm-mingw-msvcrt/bin/aarch64-w64-mingw32-ld")
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")
19+
20+
set(CMAKE_FIND_ROOT_PATH "/opt/llvm-mingw-msvcrt/aarch64-w64-mingw32")
21+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
22+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
23+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
24+
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
set(CMAKE_SYSTEM_NAME "Linux")
2+
set(CMAKE_SYSTEM_PROCESSOR "armv7l")
3+
4+
set(CMAKE_ASM_COMPILER "/usr/bin/arm-linux-gnueabihf-gcc")
5+
set(CMAKE_C_COMPILER "/usr/bin/arm-linux-gnueabihf-gcc")
6+
set(CMAKE_CXX_COMPILER "/usr/bin/arm-linux-gnueabihf-g++")
7+
8+
set(CMAKE_ADDR2LINE "/usr/bin/arm-linux-gnueabihf-addr2line")
9+
set(CMAKE_AR "/usr/bin/arm-linux-gnueabihf-ar")
10+
set(CMAKE_LINKER "/usr/bin/arm-linux-gnueabihf-ld")
11+
set(CMAKE_NM "/usr/bin/arm-linux-gnueabihf-nm")
12+
set(CMAKE_OBJCOPY "/usr/bin/arm-linux-gnueabihf-objcopy")
13+
set(CMAKE_OBJDUMP "/usr/bin/arm-linux-gnueabihf-objdump")
14+
set(CMAKE_RANLIB "/usr/bin/arm-linux-gnueabihf-ranlib")
15+
set(CMAKE_READELF "/usr/bin/arm-linux-gnueabihf-readelf")
16+
set(CMAKE_STRIP "/usr/bin/arm-linux-gnueabihf-strip")
17+
18+
set(PKG_CONFIG_EXECUTABLE "/usr/bin/pkg-config")
19+
set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/arm-linux-gnueabihf/pkgconfig")
20+
set(ENV{PKG_CONFIG_PATH} "/usr/lib/pkgconfig:/usr/share/pkgconfig")
21+
22+
set(CMAKE_FIND_ROOT_PATH "/usr/arm-linux-gnueabihf")
23+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
24+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
25+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
26+
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)

0 commit comments

Comments
 (0)