Open zflat opened 8 months ago
Hi @zflat
Thanks for your question.
I agree that that sentence is not very clear. It refers to the test_package/conanfile.py
code:
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def layout(self):
cmake_layout(self)
def test(self):
if can_run(self):
cmd = os.path.join(self.cpp.build.bindir, "example")
self.run(cmd, env="conanrun")
And that the can_run()
will return by default False
and that the example
application will not be launched, because it will fail to run in a normal windows/linux/osx machine.
This is not really related to how libraries are used by real android apps, it is just about the typical creation of an executable in test_package
. For Android, the test_package
will at least guarantee that the headers can be found, the library can be found and be linked, etc.
Please let me know if this clarifies the issue a bit.
If I understand your clarification, I would like to suggest some edits to make this more clear:
- Unless you have access to a root Android device, running the test application or using the built library is not possible directly so it is more common to build an Android application that uses the hello library.
+ The non-native test application is not possible to run on the same architecture as your local computer. Directly running the test application or using the built library is possible if you use a root Android device. It is more common to build an Android application that uses the hello library and test using typical Android development workflows.
At the very end of the https://github.com/conan-io/docs/blob/develop2/examples/cross_build/android/ndk.rst example there is the statement:
This is a pretty long sentence and I don't understand what is trying to be stated. Is it saying that this example is for a library only (Library module)? Can a similar approach be used to build an app (App module)? Or can an android app only be built from android studio as described at https://github.com/conan-io/docs/blob/develop2/examples/cross_build/android/android_studio.rst?