Check for CMAKE_TOOLCHAIN_FILE when creating cmake config
We don't do anything fancy anymore for non-cross builds and when a specific CMAKE_TOOLCHAIN_FILE is specified.
This commit is contained in:
parent
80b97c8318
commit
ba0ea33ab4
|
|
@ -30,6 +30,7 @@ pub(crate) struct Env {
|
|||
pub(crate) debug: Option<OsString>,
|
||||
pub(crate) opt_level: Option<OsString>,
|
||||
pub(crate) android_ndk_home: Option<PathBuf>,
|
||||
pub(crate) cmake_toolchain_file: Option<PathBuf>,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
|
|
@ -147,6 +148,7 @@ impl Env {
|
|||
debug: target_var("DEBUG"),
|
||||
opt_level: target_var("OPT_LEVEL"),
|
||||
android_ndk_home: target_var("ANDROID_NDK_HOME").map(Into::into),
|
||||
cmake_toolchain_file: target_var("CMAKE_TOOLCHAIN_FILE").map(Into::into),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -185,7 +185,14 @@ fn get_boringssl_cmake_config(config: &Config) -> cmake::Config {
|
|||
let src_path = get_boringssl_source_path(config);
|
||||
let mut boringssl_cmake = cmake::Config::new(src_path);
|
||||
|
||||
if config.host != config.target {
|
||||
if config.host == config.target {
|
||||
return boringssl_cmake;
|
||||
}
|
||||
|
||||
if config.env.cmake_toolchain_file.is_some() {
|
||||
return boringssl_cmake;
|
||||
}
|
||||
|
||||
// Add platform-specific parameters for cross-compilation.
|
||||
match &*config.target_os {
|
||||
"android" => {
|
||||
|
|
@ -286,7 +293,6 @@ fn get_boringssl_cmake_config(config: &Config) -> cmake::Config {
|
|||
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
boringssl_cmake
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue