Skip to content

Commit 8f814b3

Browse files
authored
Fix for multi-component Android compiler paths (#507)
NEW_STANDALONE_ANDROID_COMPILERS is a list of file names, but clang_path might be a path (containing path separators). So only the file name should be compared to the elements in NEW_STANDALONE_ANDROID_COMPILERS.
1 parent d0d6eaf commit 8f814b3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/lib.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -2766,10 +2766,9 @@ static NEW_STANDALONE_ANDROID_COMPILERS: [&str; 4] = [
27662766
// So to construct proper command line check if
27672767
// `--target` argument would be passed or not to clang
27682768
fn android_clang_compiler_uses_target_arg_internally(clang_path: &Path) -> bool {
2769-
NEW_STANDALONE_ANDROID_COMPILERS.iter().any(|x| {
2770-
let x: &OsStr = x.as_ref();
2771-
x == clang_path.as_os_str()
2772-
})
2769+
NEW_STANDALONE_ANDROID_COMPILERS
2770+
.iter()
2771+
.any(|x| Some(x.as_ref()) == clang_path.file_name())
27732772
}
27742773

27752774
fn autodetect_android_compiler(target: &str, host: &str, gnu: &str, clang: &str) -> String {

0 commit comments

Comments
 (0)