spirv-std: only enable glam&num-traits's libm features on SPIR-V targets. (#1122)

This commit is contained in:
Eduard-Mihai Burtescu 2024-02-26 13:23:24 +02:00 committed by GitHub
parent 8678d58d61
commit 9d8095177e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 3 deletions

View File

@ -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 = { 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" } 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. # Enable incremental by default in release mode.
[profile.release] [profile.release]
incremental = true incremental = true

View File

@ -42,7 +42,7 @@ syn = { version = "1", features = ["extra-traits", "full"] }
# in order to avoid multiple separate instances of `rustc_codegen_spirv`. # in order to avoid multiple separate instances of `rustc_codegen_spirv`.
hashbrown = "0.11" hashbrown = "0.11"
libc = { version = "0.2", features = ["align", "extra_traits"] } 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" once_cell = "1"
regex = { version = "1", features = ["perf"] } regex = { version = "1", features = ["perf"] }

View File

@ -11,8 +11,14 @@ repository.workspace = true
spirv-std-types.workspace = true spirv-std-types.workspace = true
spirv-std-macros.workspace = true spirv-std-macros.workspace = true
bitflags = "1.2.1" 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] [features]
default = [] default = []