mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-21 22:43:23 +00:00
Kconfig (#432)
* 内核编译配置 * 将kernel.config的解析代码搬入crate * 将设置feature函数放入CargoHandler中
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
use std::{env, path::PathBuf};
|
||||
|
||||
use crate::kconfig::Feature;
|
||||
|
||||
lazy_static! {
|
||||
static ref CARGO_HANDLER_DATA: CargoHandlerData = CargoHandlerData::new();
|
||||
}
|
||||
@ -43,6 +45,19 @@ impl CargoHandler {
|
||||
println!("cargo:rerun-if-changed={}", f.to_str().unwrap());
|
||||
}
|
||||
}
|
||||
|
||||
/// 添加features
|
||||
///
|
||||
/// ## Parameters
|
||||
///
|
||||
/// - `features` - The features to be set
|
||||
pub fn emit_features(features: &[Feature]) {
|
||||
for f in features.iter() {
|
||||
if f.enable() {
|
||||
println!("cargo:rustc-cfg=feature=\"{}\"", f.name());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// 目标架构
|
||||
|
Reference in New Issue
Block a user