@@ -305,7 +305,7 @@ impl Config {
305
305
/// This will run both the build system generator command as well as the
306
306
/// command to build the library.
307
307
pub fn build ( & mut self ) -> PathBuf {
308
- let target = match self . target . clone ( ) {
308
+ let target_triplet = match self . target . clone ( ) {
309
309
Some ( t) => t,
310
310
None => {
311
311
let mut t = getenv_unwrap ( "TARGET" ) ;
@@ -316,7 +316,7 @@ impl Config {
316
316
}
317
317
} ;
318
318
let host = self . host . clone ( ) . unwrap_or_else ( || getenv_unwrap ( "HOST" ) ) ;
319
- let msvc = target . contains ( "msvc" ) ;
319
+ let msvc = target_triplet . contains ( "msvc" ) ;
320
320
let ndk = self . uses_android_ndk ( ) ;
321
321
let mut c_cfg = cc:: Build :: new ( ) ;
322
322
c_cfg
@@ -327,7 +327,7 @@ impl Config {
327
327
. host ( & host)
328
328
. no_default_flags ( ndk) ;
329
329
if !ndk {
330
- c_cfg. target ( & target ) ;
330
+ c_cfg. target ( & target_triplet ) ;
331
331
}
332
332
let mut cxx_cfg = cc:: Build :: new ( ) ;
333
333
cxx_cfg
@@ -339,7 +339,7 @@ impl Config {
339
339
. host ( & host)
340
340
. no_default_flags ( ndk) ;
341
341
if !ndk {
342
- cxx_cfg. target ( & target ) ;
342
+ cxx_cfg. target ( & target_triplet ) ;
343
343
}
344
344
if let Some ( static_crt) = self . static_crt {
345
345
c_cfg. static_crt ( static_crt) ;
@@ -383,7 +383,7 @@ impl Config {
383
383
if let Some ( ref generator) = self . generator {
384
384
is_ninja = generator. to_string_lossy ( ) . contains ( "Ninja" ) ;
385
385
}
386
- if target . contains ( "windows-gnu" ) {
386
+ if target_triplet . contains ( "windows-gnu" ) {
387
387
if host. contains ( "windows" ) {
388
388
// On MinGW we need to coerce cmake to not generate a visual
389
389
// studio build system but instead use makefiles that MinGW can
@@ -440,22 +440,22 @@ impl Config {
440
440
// This also guarantees that NMake generator isn't chosen implicitly.
441
441
let using_nmake_generator;
442
442
if self . generator . is_none ( ) {
443
- cmd. arg ( "-G" ) . arg ( self . visual_studio_generator ( & target ) ) ;
443
+ cmd. arg ( "-G" ) . arg ( self . visual_studio_generator ( & target_triplet ) ) ;
444
444
using_nmake_generator = false ;
445
445
} else {
446
446
using_nmake_generator = self . generator . as_ref ( ) . unwrap ( ) == "NMake Makefiles" ;
447
447
}
448
448
if !is_ninja && !using_nmake_generator {
449
- if target . contains ( "x86_64" ) {
449
+ if target_triplet . contains ( "x86_64" ) {
450
450
cmd. arg ( "-Thost=x64" ) ;
451
451
cmd. arg ( "-Ax64" ) ;
452
- } else if target . contains ( "thumbv7a" ) {
452
+ } else if target_triplet . contains ( "thumbv7a" ) {
453
453
cmd. arg ( "-Thost=x64" ) ;
454
454
cmd. arg ( "-Aarm" ) ;
455
- } else if target . contains ( "aarch64" ) {
455
+ } else if target_triplet . contains ( "aarch64" ) {
456
456
cmd. arg ( "-Thost=x64" ) ;
457
457
cmd. arg ( "-AARM64" ) ;
458
- } else if target . contains ( "i686" ) {
458
+ } else if target_triplet . contains ( "i686" ) {
459
459
use cc:: windows_registry:: { find_vs_version, VsVers } ;
460
460
match find_vs_version ( ) {
461
461
Ok ( VsVers :: Vs16 ) => {
@@ -468,14 +468,14 @@ impl Config {
468
468
_ => { }
469
469
} ;
470
470
} else {
471
- panic ! ( "unsupported msvc target: {}" , target ) ;
471
+ panic ! ( "unsupported msvc target: {}" , target_triplet ) ;
472
472
}
473
473
}
474
- } else if target . contains ( "redox" ) {
474
+ } else if target_triplet . contains ( "redox" ) {
475
475
if !self . defined ( "CMAKE_SYSTEM_NAME" ) {
476
476
cmd. arg ( "-DCMAKE_SYSTEM_NAME=Generic" ) ;
477
477
}
478
- } else if target . contains ( "solaris" ) {
478
+ } else if target_triplet . contains ( "solaris" ) {
479
479
if !self . defined ( "CMAKE_SYSTEM_NAME" ) {
480
480
cmd. arg ( "-DCMAKE_SYSTEM_NAME=SunOS" ) ;
481
481
}
0 commit comments