add cxx26 support
All checks were successful
Rust Cross-Compile and Release / build_and_release (push) Successful in 2m59s

This commit is contained in:
Yakumo Hokori
2026-01-16 14:57:16 +08:00
parent 34f8384768
commit 8b2c3ffe53

View File

@@ -30,6 +30,8 @@ enum CxxStandard {
Cxx20, Cxx20,
#[value(name = "23")] #[value(name = "23")]
Cxx23, Cxx23,
#[value(name = "26")]
Cxx26,
} }
#[derive(Parser, Debug)] #[derive(Parser, Debug)]
@@ -95,6 +97,7 @@ fn generate_cmakelists(
Some(CxxStandard::Cxx17) => "17", Some(CxxStandard::Cxx17) => "17",
Some(CxxStandard::Cxx20) => "20", Some(CxxStandard::Cxx20) => "20",
Some(CxxStandard::Cxx23) => "23", Some(CxxStandard::Cxx23) => "23",
Some(CxxStandard::Cxx26) => "26",
None => "17", None => "17",
}; };
lines.push(format!("set(CMAKE_CXX_STANDARD {})", standard)); lines.push(format!("set(CMAKE_CXX_STANDARD {})", standard));
@@ -211,14 +214,15 @@ fn interactive_mode() -> Result<(String, Lang, ProjectType, Option<CxxStandard>)
}; };
let cxx_standard = if matches!(lang, Lang::Cpp) { let cxx_standard = if matches!(lang, Lang::Cpp) {
let standard_choices = vec!["11", "14", "17", "20", "23"]; let standard_choices = vec!["11", "14", "17", "20", "23", "26"];
let standard_raw = Select::new("请选择C++标准版本:", standard_choices).prompt()?; let standard_raw = Select::new("请选择C++标准版本:", standard_choices).prompt()?;
Some(match standard_raw { Some(match standard_raw {
"11" => CxxStandard::Cxx11, "11" => CxxStandard::Cxx11,
"14" => CxxStandard::Cxx14, "14" => CxxStandard::Cxx14,
"17" => CxxStandard::Cxx17, "17" => CxxStandard::Cxx17,
"20" => CxxStandard::Cxx20, "20" => CxxStandard::Cxx20,
_ => CxxStandard::Cxx23, "23" => CxxStandard::Cxx23,
_ => CxxStandard::Cxx26,
}) })
} else { } else {
None None