diff --git a/.gitignore b/.gitignore index 8de31bf..49d414c 100644 --- a/.gitignore +++ b/.gitignore @@ -22,5 +22,8 @@ docs.json __dummy.html docs/ +# Intermediate Artifacts +wgpu_bindings.i + # Code coverage *.lst diff --git a/Makefile b/Makefile index 144d048..680551d 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,12 @@ endif ifeq ($(findstring sh.exe,$(SHELL)),sh.exe) UNIX := true endif -# Else, assume a unix system -UNIX ?= true +ifeq ($(OS),Windows_NT) + UNIX ?= false +else + # Assume a unix system + UNIX ?= true +endif ifeq ($(OS),Darwin) CC := clang SED := gsed diff --git a/source/wgpu/api.d b/source/wgpu/api.d index 71c9d14..91903f2 100644 --- a/source/wgpu/api.d +++ b/source/wgpu/api.d @@ -287,8 +287,6 @@ alias RenderPassDescriptor = WGPURenderPassDescriptor; /// See_Also: wgpu::RenderPipelineDescriptor alias RenderPipelineDescriptor = WGPURenderPipelineDescriptor; -//static assert(false, std.traits.fullyQualifiedName!WGPUAdapterType); - // Structures /// Describes the multi-sampling state of a render pipeline. diff --git a/subprojects/wgpu.Makefile b/subprojects/wgpu.Makefile index 468bf8c..2d4f784 100644 --- a/subprojects/wgpu.Makefile +++ b/subprojects/wgpu.Makefile @@ -1,14 +1,21 @@ # See https://github.com/gfx-rs/wgpu-native/tree/v0.19.1.1 VERSION := v0.19.1.1 OS ?= $(shell uname -s) -ifeq ($(findstring cmd.exe,$(SHELL)),cmd.exe) - UNIX := false -endif ifeq ($(findstring sh.exe,$(SHELL)),sh.exe) UNIX := true endif -# Else, assume a unix system -UNIX ?= true +ifeq ($(OS),Windows_NT) + UNIX ?= false +else + # Assume a unix system + UNIX ?= true +endif + +ifeq ($(OS),Windows_NT) + ifndef UNIX + $(error Unsupported build envinronment. Use Developer PowerShell for Visual Studio) + endif +endif # Detect current system's CPU architecture ifeq ($(OS),Windows_NT) @@ -52,13 +59,13 @@ CONFIG ?= debug BINARY_ARCHIVE := https://github.com/gfx-rs/wgpu-native/releases/download/$(VERSION)/wgpu-$(RELEASE)-$(ARCH)-$(CONFIG).zip $(info Using $(CONFIG) wgpu-native $(VERSION) from: $(BINARY_ARCHIVE)) ifeq ($(OS),Windows_NT) -ifeq ($(UNIX),true) - ARCHIVE_DIR := $(shell echo $(USERPROFILE)/AppData/Local/WebGPU) - ARCHIVE_ZIP := $(shell echo $(USERPROFILE)/AppData/Local/WebGPU/wgpu.zip) -else - ARCHIVE_DIR := $(shell echo %USERPROFILE%/AppData/Local/WebGPU) - ARCHIVE_ZIP := $(shell echo %USERPROFILE%/AppData/Local/WebGPU/wgpu.zip) -endif + ifeq ($(UNIX),true) + ARCHIVE_DIR := $(shell echo $(USERPROFILE)/AppData/Local/WebGPU) + ARCHIVE_ZIP := $(shell echo $(USERPROFILE)/AppData/Local/WebGPU/wgpu.zip) + else + ARCHIVE_DIR := $(shell echo %USERPROFILE%/AppData/Local/WebGPU) + ARCHIVE_ZIP := $(shell echo %USERPROFILE%/AppData/Local/WebGPU/wgpu.zip) + endif else ARCHIVE_ZIP := /tmp/wgpu.zip endif @@ -76,10 +83,10 @@ endif wgpu/$(LIB_WGPU): $(ARCHIVE_ZIP) @echo Unzipping WebGPU Native binaries... -ifeq ($(UNIX),true) - @mkdir -p wgpu - @unzip -q -o $(ARCHIVE_ZIP) -d wgpu -else +ifeq ($(OS),Windows_NT) @if not exist wgpu mkdir wgpu @tar -xf $(ARCHIVE_ZIP) -C wgpu +else + @mkdir -p wgpu + @unzip -q -o $(ARCHIVE_ZIP) -d wgpu endif