-
Notifications
You must be signed in to change notification settings - Fork 34
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
fix: support android #88
fix: support android #88
Conversation
@@ -127,7 +164,8 @@ fn main() { | |||
cc.files(cpp_files) | |||
.includes(&include_paths) | |||
.cpp(true) | |||
.flag_if_supported("-std=c++14"); | |||
.flag_if_supported("-std=c++14") | |||
.target(&env::var("TARGET").unwrap()); |
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 cc
crate does support using the correct compiler based on the CC_*
and AR_*
environment variables, but it needs to know the target.
cmake_command | ||
.arg(format!("-DANDROID_PLATFORM={}", android_abi)) | ||
.arg(format!("-DANDROID_ABI={}", ndk_target)) | ||
.arg(format!("-DCMAKE_TOOLCHAIN_FILE={}", cmake_toolchain_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.
To support android, we need to specify the platform version (default will be 24, which is Android 7.0) and the ABI which will be one of the 4 specified by the root build process. Lastly, the toolchain is set to the Android toolchain.
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.
👍
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.
utACK
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.
utACK
The base branch was changed.
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.
re-utACK
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.
:)
glad we have gh rules that protected from mistakes like that |
Make changes to build.rs to support android builds.