gecko-dev/gfx/wgpu/Makefile
Dzmitry Malyshau e662646742 Bug 1596128 - Update wgpu to the version that has a separate wgpu-core
https://github.com/gfx-rs/wgpu rev d08118b535a95755c29984e256cba205172acd95

Differential Revision: https://phabricator.services.mozilla.com/D54014

--HG--
rename : gfx/wgpu/wgpu-native/Cargo.toml => gfx/wgpu/wgpu-core/Cargo.toml
rename : gfx/wgpu/wgpu-native/src/binding_model.rs => gfx/wgpu/wgpu-core/src/binding_model.rs
rename : gfx/wgpu/wgpu-native/src/command/allocator.rs => gfx/wgpu/wgpu-core/src/command/allocator.rs
rename : gfx/wgpu/wgpu-native/src/command/bind.rs => gfx/wgpu/wgpu-core/src/command/bind.rs
rename : gfx/wgpu/wgpu-native/src/conv.rs => gfx/wgpu/wgpu-core/src/conv.rs
rename : gfx/wgpu/wgpu-native/src/hub.rs => gfx/wgpu/wgpu-core/src/hub.rs
rename : gfx/wgpu/wgpu-native/src/id.rs => gfx/wgpu/wgpu-core/src/id.rs
rename : gfx/wgpu/wgpu-native/src/lib.rs => gfx/wgpu/wgpu-core/src/lib.rs
rename : gfx/wgpu/wgpu-native/src/pipeline.rs => gfx/wgpu/wgpu-core/src/pipeline.rs
rename : gfx/wgpu/wgpu-native/src/resource.rs => gfx/wgpu/wgpu-core/src/resource.rs
rename : gfx/wgpu/wgpu-native/src/track/buffer.rs => gfx/wgpu/wgpu-core/src/track/buffer.rs
rename : gfx/wgpu/wgpu-native/src/track/mod.rs => gfx/wgpu/wgpu-core/src/track/mod.rs
rename : gfx/wgpu/wgpu-native/src/track/range.rs => gfx/wgpu/wgpu-core/src/track/range.rs
rename : gfx/wgpu/wgpu-native/src/track/texture.rs => gfx/wgpu/wgpu-core/src/track/texture.rs
extra : moz-landing-system : lando
2019-11-21 21:54:26 +00:00

78 lines
2.3 KiB
Makefile

RUST_BACKTRACE:=1
EXCLUDES:=
GENERATOR_PLATFORM:=
FFI_DIR:=ffi
BUILD_DIR:=build
CLEAN_FFI_DIR:=
CREATE_BUILD_DIR:=
WILDCARD_WGPU_NATIVE:=$(wildcard wgpu-native/**/*.rs wgpu-core/**/*.rs)
WILDCARD_WGPU_REMOTE:=$(wildcard wgpu-remote/**/*.rs wgpu-core/**/*.rs)
ifeq (,$(TARGET))
CHECK_TARGET_FLAG=
else
CHECK_TARGET_FLAG=--target $(TARGET)
endif
ifeq ($(OS),Windows_NT)
CLEAN_FFI_DIR=del $(FFI_DIR)\*.* /Q /S
CREATE_BUILD_DIR=mkdir $(BUILD_DIR)
GENERATOR_PLATFORM=-DCMAKE_GENERATOR_PLATFORM=x64
else
CLEAN_FFI_DIR=rm $(FFI_DIR)/**
CREATE_BUILD_DIR=mkdir -p $(BUILD_DIR)
endif
.PHONY: all check test doc clear lib-native lib-remote \
example-compute example-triangle example-remote \
run-example-compute run-example-triangle run-example-remote
#TODO: example-remote
all: example-compute example-triangle
check:
cargo check --all
test:
cargo test --all
doc:
cargo doc --all
clear:
cargo clean
$(CLEAN_FFI_DIR)
lib-native: Cargo.lock wgpu-native/Cargo.toml $(WILDCARD_WGPU_NATIVE)
cargo build --manifest-path wgpu-native/Cargo.toml
lib-remote: Cargo.lock wgpu-remote/Cargo.toml $(WILDCARD_WGPU_REMOTE)
cargo build --manifest-path wgpu-remote/Cargo.toml
$(FFI_DIR)/wgpu.h: wgpu-native/cbindgen.toml $(WILDCARD_WGPU_NATIVE)
rustup run nightly cbindgen -o $(FFI_DIR)/wgpu.h wgpu-native
$(FFI_DIR)/wgpu-remote.h: wgpu-remote/cbindgen.toml $(WILDCARD_WGPU_REMOTE)
rustup run nightly cbindgen -o $(FFI_DIR)/wgpu-remote.h wgpu-remote
example-compute: lib-native $(FFI_DIR)/wgpu.h examples/compute/main.c
cd examples/compute && $(CREATE_BUILD_DIR) && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. $(GENERATOR_PLATFORM) && cmake --build .
run-example-compute: example-compute
cd examples/compute/build && ./compute 1 2 3 4
example-triangle: lib-native $(FFI_DIR)/wgpu.h examples/triangle/main.c
cd examples/triangle && $(CREATE_BUILD_DIR) && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. $(GENERATOR_PLATFORM) && cmake --build .
run-example-triangle: example-triangle
cd examples/triangle/build && ./triangle
example-remote: lib-remote $(FFI_DIR)/wgpu-remote.h examples/remote/main.c
cd examples/remote && $(CREATE_BUILD_DIR) && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. $(GENERATOR_PLATFORM) && cmake --build .
run-example-remote: example-remote
cd examples/remote/build && ./remote