Don't reuse the command between c/c++
@@ -52,6 +52,7 @@ fn main() {
.arg(&example));
println!("======== C/C++ example `{}` ============", example);
+ for extension in ["c", "cc"].iter() {
let mut cmd = cc::Build::new()
.opt_level(0)
.cargo_metadata(false)
@@ -64,7 +65,6 @@ fn main() {
.get_compiler()
.to_command();
- for extension in ["c", "cc"].iter() {
let file = if is_dir {
format!("examples/{}/main.{}", example, extension)
} else {
