Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cfg_aliases #4589

Merged
merged 2 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ bytemuck = { version = "1.11", features = ["extern_crate_alloc"] }
camino = "1.1"
cargo_metadata = "0.18"
cargo-run-wasm = "0.3.2"
cfg_aliases = "0.1"
cfg_aliases = "0.2"
cfg-if = "1.0"
clang-format = "0.3"
clap = "4.0"
Expand Down
21 changes: 5 additions & 16 deletions crates/re_renderer/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,11 @@ fn should_run() -> bool {
}

fn main() {
// TODO(andreas): Create an upstream PR `cfg_aliases` to fix this.
// Workaround for CARGO_CFG_DEBUG_ASSERTIONS not being set as expected.
// `cfg_aliases` relies on this.
if std::env::var("PROFILE") == Ok("debug".to_owned()) {
std::env::set_var("CARGO_CFG_DEBUG_ASSERTIONS", "1");
}

#[allow(clippy::str_to_string)]
// TODO(andreas): Create an upstream PR to `cfg_aliases` fix this.
{
cfg_aliases::cfg_aliases! {
native: { not(target_arch = "wasm32") },
webgl: { all(not(native), feature = "webgl") },
webgpu: { all(not(webgl), not(native)) },
load_shaders_from_disk: { all(native, debug_assertions) } // Shader reloading is only supported on native-debug currently.
}
cfg_aliases::cfg_aliases! {
native: { not(target_arch = "wasm32") },
webgl: { all(not(native), feature = "webgl") },
webgpu: { all(not(webgl), not(native)) },
load_shaders_from_disk: { all(native, debug_assertions) } // Shader reloading is only supported on native-debug currently.
}

if !should_run() {
Expand Down
3 changes: 2 additions & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ skip = [
{ name = "ahash" }, # Popular crate + fast release schedule = lots of crates still using old versions
{ name = "base64" }, # Too popular
{ name = "cargo_metadata" }, # Older version used by ply-rs. It's small, and it's build-time only!
{ name = "foreign-types" }, # used for cocoa bindings. wgpu uses newer than eframe.
{ name = "cfg_aliases" }, # Tiny macro-only crate. Winit and other use older version than us.
{ name = "foreign-types-shared" }, # used for cocoa bindings. wgpu uses newer than eframe.
{ name = "foreign-types" }, # used for cocoa bindings. wgpu uses newer than eframe.
{ name = "hashbrown" }, # Old version used by polar-rs
{ name = "libloading" }, # Old version used by ash (vulkan binding), newer version used by khronos-egl
{ name = "memoffset" }, # Small crate
Expand Down
Loading