-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MonoVM] support building with Android NDK r22 #51876
Conversation
Context: android/ndk#1427 (comment) Android NDK r22 changed the tree layout by moving `sysroot` from the NDK root directory to a subdirectory in the toolchains tree and also by removing per-platform library/header directories from their previous location to one under the sysroot above. MonoVM was built using the CMake's built-in Android NDK support which, alas, is not compatible with NDK r22 before CMake version 3.19. It is therefore better to use the Android CMake toolchain definition script shipped with the NDK, so that the build works regardless of CMake version installed on the system. The r22 toolchain will complain about older CMake versions: An old version of CMake is being used that cannot automatically detect compiler attributes. Compiler identification is being bypassed. Some values may be wrong or missing. Update to CMake 3.19 or newer to use CMake's built-in compiler identification. This warning can be safely ignored.
<_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(ANDROID_NDK_ROOT)/build/cmake/android.toolchain.cmake"/> | ||
<_MonoCMakeArgs Include="-DANDROID_NDK=$(ANDROID_NDK_ROOT)"/> | ||
<_MonoCMakeArgs Include="-DANDROID_STL=none"/> | ||
<_MonoCMakeArgs Include="-DANDROID_CPP_FEATURES="no-rtti no-exceptions""/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious, does this have an effect when we already have ANDROID_STL=none
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are two separate settings. ANDROID_STL
chooses libc++
, stlport
, system
and none
for the standard C++ library while ANDROID_CPP_FEATURES
chooses compiler options, effectively. Those two are independent on each other
@grendello @akoeplinger is this completely transparent to someone running |
@lambdageek the cmake toolchain file has been in NDK since 2016 (NDK r13), so that would be the lowest NDK version supported, after this PR is merged. Otherwise, it is completely transparent. |
Context: android/ndk#1427 (comment)
Android NDK r22 changed the tree layout by moving
sysroot
from the NDKroot directory to a subdirectory in the toolchains tree and also by
removing per-platform library/header directories from their previous
location to one under the sysroot above.
MonoVM was built using the CMake's built-in Android NDK support which,
alas, is not compatible with NDK r22 before CMake version 3.19. It is
therefore better to use the Android CMake toolchain definition script
shipped with the NDK, so that the build works regardless of CMake
version installed on the system.
The r22 toolchain will complain about older CMake versions:
This warning can be safely ignored.