Skip to content

Commit 1813571

Browse files
committed
Move CMake build "target" closer to its use
There is another local variable called "target" -- the one for compilation target platform. This variable is CMake build target. Move it closer to the only place where it's used to avoid shadowing the other "target", which will soon be needed.
1 parent 71c41f0 commit 1813571

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,6 @@ impl Config {
787787
}
788788

789789
// And build!
790-
let target = self.cmake_target.clone().unwrap_or("install".to_string());
791790
let mut cmd = Command::new(&executable);
792791
cmd.current_dir(&build);
793792

@@ -819,6 +818,7 @@ impl Config {
819818
cmd.arg("--build").arg(".");
820819

821820
if !self.no_build_target {
821+
let target = self.cmake_target.clone().unwrap_or("install".to_string());
822822
cmd.arg("--target").arg(target);
823823
}
824824

0 commit comments

Comments
 (0)