Skip to content

Commit

Permalink
Add SDL/GLFW native libs for win-arm64 (#1175)
Browse files Browse the repository at this point in the history
* Attempt to add GLFW build for win-arm64

* When Build.Native changes, run GLFW

* Add SDL2 ARM64 dll

* Update GLFW binaries (#1177)

* Roll back vulkan loader

* Update swiftshader

Co-authored-by: silkdotnet <85832961+silkdotnet@users.noreply.github.com>
  • Loading branch information
Beyley and silkdotnet authored Jan 15, 2023
1 parent 685324c commit db1de41
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 35 deletions.
1 change: 1 addition & 0 deletions .github/workflows/glfw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- "main"
paths:
- "build/submodules/GLFW"
- "build/nuke/Build.Native.cs"
jobs:
Build:
strategy:
Expand Down
78 changes: 44 additions & 34 deletions build/nuke/Build.Native.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ string AndroidHome
.AssertZeroExitCode();
InheritedShell(build, GLFWPath)
.AssertZeroExitCode();
CopyAll(@out.GlobFiles("src/Release/glfw3.dll"), runtimes / "win-x64" / "native");
EnsureCleanDirectory(@out);
Expand All @@ -308,6 +309,15 @@ string AndroidHome
.AssertZeroExitCode();
CopyAll(@out.GlobFiles("src/Release/glfw3.dll"), runtimes / "win-x86" / "native");
EnsureCleanDirectory(@out);
InheritedShell($"{prepare} -A arm64", GLFWPath)
.AssertZeroExitCode();
InheritedShell(build, GLFWPath)
.AssertZeroExitCode();
CopyAll(@out.GlobFiles("src/Release/glfw3.dll"), runtimes / "win-arm64" / "native");
}
else if (OperatingSystem.IsLinux())
{
Expand Down Expand Up @@ -345,40 +355,40 @@ string AndroidHome
Target VulkanLoader => CommonTarget
(
x => x.Before(Compile)
.After(Clean)
.Executes
(
() =>
{
var @out = VulkanLoaderPath / "build";
EnsureCleanDirectory(@out);
var abi = OperatingSystem.IsWindows() ? " -DCMAKE_GENERATOR_PLATFORM=Win32" : string.Empty;
InheritedShell
(
$"cmake -S. -Bbuild -DUPDATE_DEPS=On -DCMAKE_BUILD_TYPE=Release{abi}",
VulkanLoaderPath
)
.AssertZeroExitCode();
InheritedShell($"cmake --build build --config Release{JobsArg}", VulkanLoaderPath)
.AssertZeroExitCode();
var runtimes = RootDirectory / "src" / "Native" / "Silk.NET.Vulkan.Loader.Native" / "runtimes";
if (OperatingSystem.IsWindows())
{
CopyAll(@out.GlobFiles("loader/Release/vulkan-1.dll"), runtimes / "win-x64" / "native");
CopyAll(@out.GlobFiles("loader/Release/vulkan-1.dll"), runtimes / "win-x86" / "native");
}
else
{
CopyAll
(
@out.GlobFiles("loader/libvulkan.so", "loader/libvulkan.dylib"),
runtimes / (OperatingSystem.IsMacOS() ? "osx-x64" : "linux-x64") / "native"
);
}
PrUpdatedNativeBinary("Vulkan Loader");
}
)
.After(Clean)
.Executes
(
() =>
{
var @out = VulkanLoaderPath / "build";
EnsureCleanDirectory(@out);
var abi = OperatingSystem.IsWindows() ? " -DCMAKE_GENERATOR_PLATFORM=Win32" : string.Empty;
InheritedShell
(
$"cmake -S. -Bbuild -DUPDATE_DEPS=On -DCMAKE_BUILD_TYPE=Release{abi}",
VulkanLoaderPath
)
.AssertZeroExitCode();
InheritedShell($"cmake --build build --config Release{JobsArg}", VulkanLoaderPath)
.AssertZeroExitCode();
var runtimes = RootDirectory / "src" / "Native" / "Silk.NET.Vulkan.Loader.Native" / "runtimes";
if (OperatingSystem.IsWindows())
{
CopyAll(@out.GlobFiles("loader/Release/vulkan-1.dll"), runtimes / "win-x64" / "native");
CopyAll(@out.GlobFiles("loader/Release/vulkan-1.dll"), runtimes / "win-x86" / "native");
}
else
{
CopyAll
(
@out.GlobFiles("loader/libvulkan.so", "loader/libvulkan.dylib"),
runtimes / (OperatingSystem.IsMacOS() ? "osx-x64" : "linux-x64") / "native"
);
}
PrUpdatedNativeBinary("Vulkan Loader");
}
)
);

AbsolutePath AssimpPath => RootDirectory / "build" / "submodules" / "Assimp";
Expand Down
2 changes: 1 addition & 1 deletion build/submodules/SwiftShader
Submodule SwiftShader updated 726 files
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit db1de41

Please sign in to comment.