Browse Source

Use cfg-if

pull/14/head
AzureMarker 3 years ago
parent
commit
1c66a1c770
No known key found for this signature in database
GPG Key ID: 47A133F3BF9D03D3
  1. 1
      ctru-rs/Cargo.toml
  2. 31
      ctru-rs/src/lib.rs

1
ctru-rs/Cargo.toml

@ -11,6 +11,7 @@ crate-type = ["rlib"]
name = "ctru" name = "ctru"
[dependencies] [dependencies]
cfg-if = "1.0"
ctru-sys = { path = "../ctru-sys", version = "0.4" } ctru-sys = { path = "../ctru-sys", version = "0.4" }
const-zero = "0.1.0" const-zero = "0.1.0"
linker-fix-3ds = { git = "https://github.com/Meziu/rust-linker-fix-3ds.git" } linker-fix-3ds = { git = "https://github.com/Meziu/rust-linker-fix-3ds.git" }

31
ctru-rs/src/lib.rs

@ -37,20 +37,23 @@ pub mod services;
pub mod srv; pub mod srv;
pub mod thread; pub mod thread;
#[cfg(all(feature = "romfs", romfs_exists))] cfg_if::cfg_if! {
pub mod romfs; if #[cfg(all(feature = "romfs", romfs_exists))] {
#[cfg(not(all(feature = "romfs", romfs_exists)))] pub mod romfs;
pub mod romfs { } else {
//! The RomFS folder has not been detected and/or the `romfs` feature has not been enabled. pub mod romfs {
//! //! The RomFS folder has not been detected and/or the `romfs` feature has not been enabled.
//! Configure the path in Cargo.toml (the default path is "romfs"). Paths are relative to the //!
//! `CARGO_MANIFEST_DIR` environment variable, which is the directory containing the manifest of //! Configure the path in Cargo.toml (the default path is "romfs"). Paths are relative to the
//! your package. //! `CARGO_MANIFEST_DIR` environment variable, which is the directory containing the manifest of
//! //! your package.
//! ```toml //!
//! [package.metadata.cargo-3ds] //! ```toml
//! romfs_dir = "romfs" //! [package.metadata.cargo-3ds]
//! ``` //! romfs_dir = "romfs"
//! ```
}
}
} }
pub use crate::error::{Error, Result}; pub use crate::error::{Error, Result};

Loading…
Cancel
Save