Don't reuse the command between c/c++

This commit is contained in:
Alexandru Ene
2020-06-19 00:14:29 +01:00
parent 9213717917
commit 38f4ed084d

View File

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