diff options
author | Jo Shields <directhex@apebox.org> | 2022-01-28 23:15:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-28 23:15:35 +0300 |
commit | c7adf5598f27e59644030ddae4e382cbda74e41e (patch) | |
tree | 6498fe8f1bafb953dfe9a01d96e78de5faab0cb2 /eng/native | |
parent | 315fb41e7d75f3103a50aa394e2698baf5e56252 (diff) |
Check for CMAKE_C_COMPILER_ID not CXX (#64226)
* Check for CMAKE_C_COMPILER_ID not CXX
In some cases, CMAKE_CXX_COMPILER_ID might not be populated,
which causes the toolchaine prefix checks to be ignored, which
causes the build to look for `ranlib` not `llvm-ranlib`, which
causes it to use XCode ranlib instead of Android NDK ranlib for
builds, which doesn't work.
Hopefully (we'll see what CI says) this doesn't regress other builds.
Closes: #55412
* Update eng/native/configuretools.cmake
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
* Use llvm-objcopy, not GNU, on Android
It's available in r21 (which we use today) and works for r23
(which has no GNU objcopy any more and breaks without this change)
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Diffstat (limited to 'eng/native')
-rw-r--r-- | eng/native/configuretools.cmake | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/eng/native/configuretools.cmake b/eng/native/configuretools.cmake index ad5dc38107c..860e46427b6 100644 --- a/eng/native/configuretools.cmake +++ b/eng/native/configuretools.cmake @@ -7,15 +7,15 @@ if (CMAKE_C_COMPILER MATCHES "-?[0-9]+(\.[0-9]+)?$") endif() if(NOT WIN32 AND NOT CLR_CMAKE_TARGET_BROWSER) - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if(CMAKE_C_COMPILER_ID MATCHES "Clang") if(APPLE) set(TOOLSET_PREFIX "") else() set(TOOLSET_PREFIX "llvm-") endif() - elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + elseif(CMAKE_C_COMPILER_ID MATCHES "GNU") if(CMAKE_CROSSCOMPILING) - set(TOOLSET_PREFIX "${CMAKE_CXX_COMPILER_TARGET}-") + set(TOOLSET_PREFIX "${CMAKE_C_COMPILER_TARGET}-") else() set(TOOLSET_PREFIX "") endif() |