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

fix: support android #88

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

HashEngineering
Copy link

Make changes to build.rs to support android builds.

@@ -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());
Copy link
Author

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.

Comment on lines +102 to +105
cmake_command
.arg(format!("-DANDROID_PLATFORM={}", android_abi))
.arg(format!("-DANDROID_ABI={}", ndk_target))
.arg(format!("-DCMAKE_TOOLCHAIN_FILE={}", cmake_toolchain_path));
Copy link
Author

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.

shumkov
shumkov previously approved these changes May 25, 2024
Copy link
Member

@shumkov shumkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

ogabrielides
ogabrielides previously approved these changes Oct 4, 2024
Copy link
Collaborator

@ogabrielides ogabrielides left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

UdjinM6
UdjinM6 previously approved these changes Oct 4, 2024
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@ogabrielides ogabrielides changed the base branch from main to develop October 4, 2024 12:18
@ogabrielides ogabrielides dismissed stale reviews from UdjinM6, shumkov, and themself October 4, 2024 12:18

The base branch was changed.

Copy link
Collaborator

@ogabrielides ogabrielides left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-utACK

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

@ogabrielides ogabrielides merged commit 0f4efc9 into dashpay:develop Oct 4, 2024
27 checks passed
@UdjinM6
Copy link

UdjinM6 commented Oct 4, 2024

glad we have gh rules that protected from mistakes like that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants