Skip to content

Commit d64e073

Browse files
authored
Merge pull request #63 from jake-ruyi/master
Move is_ninja check earlier and no -Thost with cmake -G Ninja
2 parents a3058a5 + 9bb0f63 commit d64e073

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ impl Config {
344344

345345
cmd.arg(&self.path)
346346
.current_dir(&build);
347+
let mut is_ninja = false;
348+
if let Some(ref generator) = self.generator {
349+
is_ninja = generator.to_string_lossy().contains("Ninja");
350+
}
347351
if target.contains("windows-gnu") {
348352
if host.contains("windows") {
349353
// On MinGW we need to coerce cmake to not generate a visual
@@ -394,7 +398,7 @@ impl Config {
394398
if self.generator.is_none() {
395399
cmd.arg("-G").arg(self.visual_studio_generator(&target));
396400
}
397-
if target.contains("x86_64") {
401+
if target.contains("x86_64") && !is_ninja {
398402
cmd.arg("-Thost=x64");
399403
}
400404
} else if target.contains("redox") {
@@ -406,10 +410,8 @@ impl Config {
406410
cmd.arg("-DCMAKE_SYSTEM_NAME=SunOS");
407411
}
408412
}
409-
let mut is_ninja = false;
410413
if let Some(ref generator) = self.generator {
411414
cmd.arg("-G").arg(generator);
412-
is_ninja = generator.to_string_lossy().contains("Ninja");
413415
}
414416
let profile = self.profile.clone().unwrap_or_else(|| {
415417
// Automatically set the `CMAKE_BUILD_TYPE` if the user did not

0 commit comments

Comments
 (0)