| //! This build script detects target platforms that lack proper support for
|
| //! atomics and sets `cfg` flags accordingly.
|
| let target = match rustc_target() {
|
| if target_has_atomic_cas(&target) {
|
| println!("cargo:rustc-cfg=atomic_cas");
|
| if target_has_atomics(&target) {
|
| println!("cargo:rustc-cfg=has_atomics");
|
| println!("cargo:rerun-if-changed=build.rs");
|
| fn target_has_atomic_cas(target: &str) -> bool {
|
| | "riscv32i-unknown-none-elf"
|
| | "riscv32imc-unknown-none-elf" => false,
|
| fn target_has_atomics(target: &str) -> bool {
|
| | "riscv32i-unknown-none-elf"
|
| | "riscv32imc-unknown-none-elf" => false,
|
| fn rustc_target() -> Option<String> {
|