Fix disabling the self_modifying feature

This commit is contained in:
bjorn3
2024-01-24 14:07:57 +01:00
parent e5c93ae334
commit 732fad0593
+7 -1
View File
@@ -23,10 +23,16 @@ fn parse_kconfig(arch: &str) -> Option<()> {
.as_table()
.unwrap();
let self_modifying = env::var("CARGO_FEATURE_SELF_MODIFYING").is_ok();
for (name, value) in altfeatures {
let choice = value.as_str().unwrap();
let mut choice = value.as_str().unwrap();
assert!(matches!(choice, "always" | "never" | "auto"));
if !self_modifying && choice == "auto" {
choice = "never";
}
println!("cargo:rustc-cfg=cpu_feature_{choice}=\"{name}\"");
}