Skip to content

Commit

Permalink
Windows bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
SogoCZE committed Aug 13, 2024
1 parent 57e24f3 commit daea795
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 64 deletions.
8 changes: 4 additions & 4 deletions wgpu/generate.jai
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,18 @@ run_cmd :: (command: [] string, working_directory: string, print_live := false)
get_builded_lib_path :: (platform: Operating_System_Tag, target: string, release: bool) -> string {
extension: string;
if platform == .MACOS || platform == .IOS {
extension = "dylib";
extension = "libwgpu_native.dylib";
}

if platform == .WINDOWS {
extension = "dll";
extension = "wgpu_native.dll";
}

if platform == .LINUX || platform == .ANDROID {
extension = "so";
extension = "libwgpu_native.so";
}

return sprint("./wgpu-native/target/%/%/libwgpu_native.%", target, ifx release then "release" else "debug", extension);
return sprint("./wgpu-native/target/%/%/%", target, ifx release then "release" else "debug", extension);
}

build :: (platform: Operating_System_Tag, release := true) -> bool {
Expand Down
13 changes: 13 additions & 0 deletions wgpu/module.jai
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@
#if OS == .MACOS {
libwgpu_native :: #library "macos/libwgpu_native";
} else #if OS == .WINDOWS {
// This is weird...
userenv :: #system_library,link_always "userenv";
ws2_32 :: #system_library,link_always "ws2_32";
d3dcompiler :: #system_library,link_always "d3dcompiler";
D3D12 :: #system_library,link_always "D3D12";
DXGI :: #system_library,link_always "DXGI";
Dwmapi :: #system_library,link_always "Dwmapi";
Bcrypt :: #system_library,link_always "bcrypt";
Wingdi :: #system_library,link_always "Gdi32";
OpenGL32 :: #system_library,link_always "Opengl32";
User32 :: #system_library,link_always "User32";
ntdll :: #system_library,link_always "ntdll";

libwgpu_native :: #library "windows/libwgpu_native";
} else #if OS == .LINUX {
libwgpu_native :: #library "linux/libwgpu_native";
Expand Down
Loading

0 comments on commit daea795

Please sign in to comment.