Skip to content
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

Build Android in C++17 mode #64305

Merged
merged 7 commits into from
Mar 16, 2023
Merged

Conversation

BrettDong
Copy link
Member

Summary

None

Purpose of change

Describe the solution

  • The problem is to compile the Android NDK project in C++17.
  • However the NDK r21 version used by the gradle project does not fully support C++17 and results in linking errors related to missing symbols in std::filesystem.
  • std::filesystem support android/ndk#609 pointed out that C++17 support landed in NDK r23.
  • Tried to override NDK version but resulted in cryptic errors
  • Then tried to update Android Gradle Plugin to a modern version 7.4.2 and also updated gradle wrapper to 8.5
  • Needed to migrate away from some deprecated API usages or the project would refuse to build
  • Then overrode NDK version to r25 and compile in C++17 mode
  • Needed to increase minimum Android API version to 21
  • Got link error /usr/bin/ld.gold: fatal error: unsupported ELF machine number 183
  • Change linker to lld
  • Success

Describe alternatives you've considered

Testing

Additional context

@github-actions github-actions bot added <Bugfix> This is a fix for a bug (or closes open issue) astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Mar 16, 2023
@kevingranade kevingranade merged commit cf055d3 into CleverRaven:master Mar 16, 2023
@jbytheway
Copy link
Contributor

Thanks very much for fixing that!

@BrettDong BrettDong deleted the android branch March 25, 2023 14:26
scarf005 added a commit to scarf005/Cataclysm-BN that referenced this pull request Sep 27, 2023
github-merge-queue bot pushed a commit to cataclysmbnteam/Cataclysm-BN that referenced this pull request Sep 27, 2023
* build: bump android ndk

see: CleverRaven/Cataclysm-DDA#64305

Co-authored-by: Brett Dong <[email protected]>

* ci: bump jdk version to 11

---------

Co-authored-by: Brett Dong <[email protected]>
scarf005 added a commit to scarf005/Cataclysm-BN that referenced this pull request Sep 28, 2023
* build: bump android ndk

see: CleverRaven/Cataclysm-DDA#64305

Co-authored-by: Brett Dong <[email protected]>

* ci: bump jdk version to 11

---------

Co-authored-by: Brett Dong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android builds failing
3 participants