Skip to content

Commit

Permalink
spirv-std: only enable glam&num-traits's libm features on SPIR-…
Browse files Browse the repository at this point in the history
…V targets. (#1122)
  • Loading branch information
eddyb committed Feb 26, 2024
1 parent 8678d58 commit 9d80951
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ spirv-tools = { version = "0.10", default-features = false }
rustc_codegen_spirv = { path = "./crates/rustc_codegen_spirv", version = "=0.9.0", default-features = false }
rustc_codegen_spirv-types = { path = "./crates/rustc_codegen_spirv-types", version = "=0.9.0" }

# External dependencies that need to be mentioned more than once.
num-traits = { version = "0.2.15", default-features = false }
glam = { version = ">=0.22, <=0.24", default-features = false }

# Enable incremental by default in release mode.
[profile.release]
incremental = true
Expand Down
2 changes: 1 addition & 1 deletion crates/rustc_codegen_spirv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ syn = { version = "1", features = ["extra-traits", "full"] }
# in order to avoid multiple separate instances of `rustc_codegen_spirv`.
hashbrown = "0.11"
libc = { version = "0.2", features = ["align", "extra_traits"] }
num-traits = { version = "0.2", features = ["libm"] }
num-traits = { workspace = true, default-features = true }
once_cell = "1"
regex = { version = "1", features = ["perf"] }

Expand Down
10 changes: 8 additions & 2 deletions crates/spirv-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ repository.workspace = true
spirv-std-types.workspace = true
spirv-std-macros.workspace = true
bitflags = "1.2.1"
num-traits = { version = "0.2.15", default-features = false, features = ["libm"] }
glam = { version = ">=0.22, <=0.24", default-features = false, features = ["libm"] }

[target.'cfg(target_arch = "spirv")'.dependencies]
num-traits = { workspace = true, features = ["libm"] }
glam = { workspace = true, features = ["libm"] }

[target.'cfg(not(target_arch = "spirv"))'.dependencies]
num-traits = { workspace = true, default-features = true }
glam = { workspace = true, default-features = true }

[features]
default = []

0 comments on commit 9d80951

Please sign in to comment.