Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b2c3ffe53 |
@@ -30,6 +30,8 @@ enum CxxStandard {
|
||||
Cxx20,
|
||||
#[value(name = "23")]
|
||||
Cxx23,
|
||||
#[value(name = "26")]
|
||||
Cxx26,
|
||||
}
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
@@ -95,6 +97,7 @@ fn generate_cmakelists(
|
||||
Some(CxxStandard::Cxx17) => "17",
|
||||
Some(CxxStandard::Cxx20) => "20",
|
||||
Some(CxxStandard::Cxx23) => "23",
|
||||
Some(CxxStandard::Cxx26) => "26",
|
||||
None => "17",
|
||||
};
|
||||
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 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()?;
|
||||
Some(match standard_raw {
|
||||
"11" => CxxStandard::Cxx11,
|
||||
"14" => CxxStandard::Cxx14,
|
||||
"17" => CxxStandard::Cxx17,
|
||||
"20" => CxxStandard::Cxx20,
|
||||
_ => CxxStandard::Cxx23,
|
||||
"23" => CxxStandard::Cxx23,
|
||||
_ => CxxStandard::Cxx26,
|
||||
})
|
||||
} else {
|
||||
None
|
||||
|
||||
Reference in New Issue
Block a user