-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Compile for armv8. #2816
Compile for armv8. #2816
Conversation
I create a standalone toolchain use following command:
Here is my cmake command:
And I met some error:
Are there any extra limits to the ndk version or android api level? |
Discussed with @hedaoyuan , we found the error is caused by wrongly finding the host boost library. Current solution is to disable all the boost-related and refactor-related codes. |
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.
It is almost ok and I can compile for armv8, but not run the unittests because I have no android phone of armv8 architecture.
Another change suggested to made to support cmake of higher version. Change line 196-197 in android.cmake
to:
IF(ANDROID_ABI MATCHES "^armeabi(-v7a)?$")
SET(CMAKE_ANDROID_ARM_MODE ${ANDROID_ARM_MODE})
IF(ANDROID_ABI STREQUAL "armeabi-v7a")
SET(CMAKE_ANDROID_ARM_NEON ${ANDROID_ARM_NEON})
ENDIF()
ENDIF()
ELSEIF(ANDROID_ABI STREQUAL "arm64-v8a") | ||
SET(TARGET "ARMV8") | ||
ENDIF() | ||
SET(OPTIONAL_ARGS HOSTCC=${HOST_C_COMPILER} TARGET=${TARGET} ARM_SOFTFP_ABI=1 USE_THREAD=0) |
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.
Just remind here, ARM_SOFTFP_ABI=1
is of no use for ARMV8
, however, it won't make any difference for the building process. And there is no need of softfp
support for armv8
, thus we may use the master or other branchs, if they are faster.
@@ -90,7 +90,7 @@ | |||
# including binary directory for generated headers. | |||
include_directories(${CMAKE_CURRENT_BINARY_DIR}) | |||
|
|||
if(NOT APPLE) | |||
if(NOT APPLE AND NOT ANDROID) |
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.
Remove NOT APPLE
in line 97, or add AND NOT ANDROID
as this line.
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.
Done.
Cmake support for the compilation of armv8(Android).