File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ pub(crate) struct Config {
1010 pub ( crate ) target : String ,
1111 pub ( crate ) target_arch : String ,
1212 pub ( crate ) target_os : String ,
13+ pub ( crate ) unix : bool ,
1314 pub ( crate ) features : Features ,
1415 pub ( crate ) env : Env ,
1516}
@@ -46,6 +47,7 @@ impl Config {
4647 let target = env:: var ( "TARGET" ) . unwrap ( ) ;
4748 let target_arch = env:: var ( "CARGO_CFG_TARGET_ARCH" ) . unwrap ( ) ;
4849 let target_os = env:: var ( "CARGO_CFG_TARGET_OS" ) . unwrap ( ) ;
50+ let unix = env:: var ( "CARGO_CFG_UNIX" ) . is_ok ( ) ;
4951
5052 let features = Features :: from_env ( ) ;
5153 let env = Env :: from_env ( & host, & target, features. is_fips_like ( ) ) ;
@@ -63,6 +65,7 @@ impl Config {
6365 target,
6466 target_arch,
6567 target_os,
68+ unix,
6669 features,
6770 env,
6871 } ;
Original file line number Diff line number Diff line change @@ -262,8 +262,8 @@ fn get_boringssl_cmake_config(config: &Config) -> cmake::Config {
262262 boringssl_cmake. define ( "CMAKE_TOOLCHAIN_FILE" , toolchain_file) ;
263263
264264 // 21 is the minimum level tested. You can give higher value.
265- boringssl_cmake. define ( "ANDROID_NATIVE_API_LEVEL " , "21" ) ;
266- boringssl_cmake. define ( "ANDROID_STL " , "c++_shared" ) ;
265+ boringssl_cmake. define ( "CMAKE_SYSTEM_VERSION " , "21" ) ;
266+ boringssl_cmake. define ( "CMAKE_ANDROID_STL_TYPE " , "c++_shared" ) ;
267267 }
268268
269269 "macos" => {
@@ -561,14 +561,11 @@ fn get_cpp_runtime_lib(config: &Config) -> Option<String> {
561561 return cpp_lib. clone ( ) . into_string ( ) . ok ( ) ;
562562 }
563563
564- // TODO(rmehra): figure out how to do this for windows
565- if env:: var_os ( "CARGO_CFG_UNIX" ) . is_some ( ) {
566- match env:: var ( "CARGO_CFG_TARGET_OS" ) . unwrap ( ) . as_ref ( ) {
567- "macos" | "ios" | "freebsd" => Some ( "c++" . into ( ) ) ,
568- _ => Some ( "stdc++" . into ( ) ) ,
569- }
570- } else {
571- None
564+ match & * config. target_os {
565+ "macos" | "ios" | "freebsd" | "android " => Some ( "c++" . into ( ) ) ,
566+ _ if config. unix => Some ( "stdc++" . into ( ) ) ,
567+ // TODO(rmehra): figure out how to do this for windows
568+ _ => None ,
572569 }
573570}
574571
You can’t perform that action at this time.
0 commit comments