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

How to use NDK_ANALYZE when I compiled with cmake ? #1072

Closed
wustwg opened this issue Sep 3, 2019 · 5 comments
Closed

How to use NDK_ANALYZE when I compiled with cmake ? #1072

wustwg opened this issue Sep 3, 2019 · 5 comments
Labels

Comments

@wustwg
Copy link

wustwg commented Sep 3, 2019

I just find how to use NDK_ANALYZE when I compile project with ndk-build ,but I can't find any samples or docs about using NDK_ANALYZE in cmake proj.
I don't know how to using "scan-build" or "NDK_ANALYZE" in android cmake projects,please help me .
Thank you very much!!!

@wustwg wustwg added the question label Sep 3, 2019
@DanAlbert
Copy link
Member

https://stackoverflow.com/a/21785566/632035 seems to be the most sensible solution. We shouldn't be adding any Android-specific workflow for this because we should be getting more like a typical CMake project, not less. If there needs to be a specific CMake affordance for this that should be raised as a CMake bug so it can work for every platform, not just Android.

If you're depending on ndk-build features, why not just stick with ndk-build?

@wustwg
Copy link
Author

wustwg commented Sep 6, 2019

https://stackoverflow.com/a/21785566/632035
This problem is different from mine. The Android project is special and different from the ordinary Make project.
The reason I use CMake is that CMake supports native code better than android.mk.
Thank you for your answer. I'll go to CMake Project for a question.

@DanAlbert
Copy link
Member

That example is for CMake.

The reason I use CMake is that CMake supports native code better than android.mk.

In what ways? Depending on what it is, it might be something we can fix.

@wustwg
Copy link
Author

wustwg commented Sep 7, 2019

The CPP code in our project uses cmake directly, so the CPP code will be prompted when writing the code. And now Android officials also recommend that you use cmake to do CPP support. And cmake is also cross-platform, better portability.

@DanAlbert
Copy link
Member

The CPP code in our project uses cmake directly, so the CPP code will be prompted when writing the code.

I don't follow.

And now Android officials also recommend that you use cmake to do CPP support.

We don't (this is why I asked this question in the first place; somehow a lot of people got the impression that CMake is preferred over ndk-build and that isn't true). We recommend you use whichever works best for you. Given that ndk-build was working for.yoi and you're having trouble with CMake, maybe shouldn't switch?

And cmake is also cross-platform, better portability.

OTOH if this is something you have to deal with then CMake is a good bet.

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

No branches or pull requests

2 participants