-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Android Intel 32/64 bit (i.e. Android Simulator) support. #25098
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -186,6 +186,16 @@ macro(configure_sdk_unix name architectures) | |
set(SWIFT_SDK_ANDROID_ARCH_${arch}_ALT_SPELLING "aarch64") | ||
set(SWIFT_SDK_ANDROID_ARCH_${arch}_PATH "${SWIFT_ANDROID_NDK_PATH}/platforms/android-${SWIFT_ANDROID_API_LEVEL}/arch-arm64") | ||
set(SWIFT_SDK_ANDROID_ARCH_${arch}_TRIPLE "aarch64-unknown-linux-android") | ||
elseif("${arch}" STREQUAL "i686") | ||
set(SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_TRIPLE "i686-linux-android") | ||
set(SWIFT_SDK_ANDROID_ARCH_${arch}_ALT_SPELLING "i686") | ||
set(SWIFT_SDK_ANDROID_ARCH_${arch}_PATH "${SWIFT_ANDROID_NDK_PATH}/platforms/android-${SWIFT_ANDROID_API_LEVEL}/arch-x86") | ||
set(SWIFT_SDK_ANDROID_ARCH_${arch}_TRIPLE "i686-unknown-linux-android") | ||
elseif("${arch}" STREQUAL "x86_64") | ||
set(SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_TRIPLE "x86_64-linux-android") | ||
set(SWIFT_SDK_ANDROID_ARCH_${arch}_ALT_SPELLING "x86_64") | ||
set(SWIFT_SDK_ANDROID_ARCH_${arch}_PATH "${SWIFT_ANDROID_NDK_PATH}/platforms/android-${SWIFT_ANDROID_API_LEVEL}/arch-x86_64") | ||
set(SWIFT_SDK_ANDROID_ARCH_${arch}_TRIPLE "x86_64-unknown-linux-android") | ||
else() | ||
message(FATAL_ERROR "unknown arch for android SDK: ${arch}") | ||
endif() | ||
|
@@ -196,8 +206,16 @@ macro(configure_sdk_unix name architectures) | |
elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux") | ||
set(_swift_android_prebuilt_build "linux-x86_64") | ||
endif() | ||
set(SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_PREBUILT_PATH | ||
if("${arch}" STREQUAL "i686") | ||
set(SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_PREBUILT_PATH | ||
"${SWIFT_ANDROID_NDK_PATH}/toolchains/x86-${SWIFT_ANDROID_NDK_GCC_VERSION}/prebuilt/${_swift_android_prebuilt_build}") | ||
elseif("${arch}" STREQUAL "x86_64") | ||
set(SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_PREBUILT_PATH | ||
"${SWIFT_ANDROID_NDK_PATH}/toolchains/x86_64-${SWIFT_ANDROID_NDK_GCC_VERSION}/prebuilt/${_swift_android_prebuilt_build}") | ||
else() | ||
set(SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_PREBUILT_PATH | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we not use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is what I getting:
So, expression Details of cmake log:
|
||
"${SWIFT_ANDROID_NDK_PATH}/toolchains/${SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_TRIPLE}-${SWIFT_ANDROID_NDK_GCC_VERSION}/prebuilt/${_swift_android_prebuilt_build}") | ||
endif() | ||
else() | ||
if(NOT SWIFT_SDK_${prefix}_ARCH_${arch}_PATH) | ||
set(SWIFT_SDK_${prefix}_ARCH_${arch}_PATH "/") | ||
|
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.
I know that you are trying to match the surrounding code, but no point in the
${arch}
substitution here, just spell it out.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.
Sorry, I didn't get .)
I am building swift with the following architectures:
-DSWIFT_SDK_ANDROID_ARCHITECTURES="armv7;aarch64;i686;x86_64"
Without changes above cmake will raise error:
Or you mean that triples
x86_64-unknown-linux-android
andi686-unknown-linux-android
is not something expected?Thank you!
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.
I think he means that instead of
SWIFT_SDK_ANDROID_ARCH_${arch}_TRIPLE
you can writeSWIFT_SDK_ANDROID_ARCH_x86_64_TRIPLE
.Personally, I prefer the
${arch}
in the middle because it is easier for copy/pasting in new architectures, and also because it avoids typos in the name of the variables.