-
Notifications
You must be signed in to change notification settings - Fork 10.5k
cmake: add android runtime build caches #59173
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
Merged
+55
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
set(SWIFT_HOST_VARIANT_SDK ANDROID CACHE STRING "") | ||
set(SWIFT_HOST_VARIANT_ARCH aarch64 CACHE STRING "") | ||
|
||
# NOTE(compnerd) disable the tools, we are trying to build just the standard | ||
# library. | ||
set(SWIFT_INCLUDE_TOOLS NO CACHE BOOL "") | ||
|
||
# NOTE(compnerd) cannot build tests since the tests require the toolchain | ||
set(SWIFT_INCLUDE_TESTS NO CACHE BOOL "") | ||
|
||
# NOTE(compnerd) cannot build docs since that requires perl | ||
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "") | ||
|
||
# NOTE(compnerd) these are part of the toolchain, not the runtime. | ||
set(SWIFT_BUILD_SYNTAXPARSERLIB NO CACHE BOOL "") | ||
set(SWIFT_BUILD_SOURCEKIT NO CACHE BOOL "") | ||
|
||
# NOTE(compnerd) build with the compiler specified, not a just built compiler. | ||
set(SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER YES CACHE BOOL "") | ||
|
||
set(SWIFT_SDK_ANDROID_ARCHITECTURES aarch64 CACHE STRING "") | ||
|
||
# NOTE(compnerd) this is lollipop, which seems to still have decent usage. | ||
set(SWIFT_ANDROID_API_LEVEL 21 CACHE STRING "") | ||
# NOTE(compnerd) this matches the value from the NDK r24. | ||
set(SWIFT_ANDROID_NDK_CLANG_VERSION 14.0.1 CACHE STRING "" FORCE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
set(SWIFT_HOST_VARIANT_SDK ANDROID CACHE STRING "") | ||
set(SWIFT_HOST_VARIANT_ARCH armv7 CACHE STRING "") | ||
|
||
# NOTE(compnerd) disable the tools, we are trying to build just the standard | ||
# library. | ||
set(SWIFT_INCLUDE_TOOLS NO CACHE BOOL "") | ||
|
||
# NOTE(compnerd) cannot build tests since the tests require the toolchain | ||
set(SWIFT_INCLUDE_TESTS NO CACHE BOOL "") | ||
|
||
# NOTE(compnerd) cannot build docs since that requires perl | ||
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "") | ||
|
||
# NOTE(compnerd) these are part of the toolchain, not the runtime. | ||
set(SWIFT_BUILD_SYNTAXPARSERLIB NO CACHE BOOL "") | ||
set(SWIFT_BUILD_SOURCEKIT NO CACHE BOOL "") | ||
|
||
# NOTE(compnerd) build with the compiler specified, not a just built compiler. | ||
set(SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER YES CACHE BOOL "") | ||
|
||
set(SWIFT_SDK_ANDROID_ARCHITECTURES armv7 CACHE STRING "") | ||
|
||
# NOTE(compnerd) this is lollipop, which seems to still have decent usage. | ||
set(SWIFT_ANDROID_API_LEVEL 21 CACHE STRING "") | ||
# NOTE(compnerd) this matches the value from the NDK r24. | ||
set(SWIFT_ANDROID_NDK_CLANG_VERSION 14.0.1 CACHE STRING "" FORCE) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The latest LTS NDK 23c was just released and it uses 12.0.9, I think it'd be better to use that but up to you. I was planning on submitting a pull updating that in the default CMake configuration and the docs.
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 that going with the latest release is reasonable, but so is the LTS release. I think that I am going to go with this for the time being, but this is something to revisit in the future. A more interesting thing would be to see if we can completely remove the need to specify the version and compute that dynamically instead.