Cross compiling from Linux to Android
See original GitHub issueI am trying to build an Android project from Linux. I am getting the following message from conan package tools.
Page : 1
Builds list:
[('settings', {'os': 'Android', 'os.api_level': 24, 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'clang', 'compiler.version': '5.0', 'compiler.libcxx': 'libc++'}), ('options', {}), ('env_vars', {}), ('build_requires', {})]
############## CONAN PACKAGE TOOLS ######################
DEBUG: - Skipped build, compiler mismatch: {'arch': 'x86', 'build_type': 'Debug', 'compiler': 'clang', 'compiler.libcxx': 'libc++', 'compiler.version': '5.0', 'os': 'Android', 'os.api_level': '24'}
#########################################################
If I run
conan create orhun/testing -s os=Android -s os.api_level=24 ...
directly it works.- If I remove relevant code from
_run_test_package
intest_package_runner.py
, it works.
Is the check in _run_test_package
in error or am I missing something?
Thanks.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Cross compiling a C program for android
I am trying to copy an executable from my Linux machine (Ubuntu) to an Android app as an asset.
Read more >Cross Compiling C/C++ for Android - Nick Desaulniers
This will create a nice standalone bundle in ~/arm . It will contain our cross compiler, linker, headers, libs, and sysroot (crt.o and...
Read more >Cross compile from GNU Linux to Android
Webcamoid is a full featured and multiplatform webcam suite. - Cross compile from GNU Linux to Android · webcamoid/webcamoid Wiki.
Read more >Use the NDK with other build systems
Some makefile projects allow cross compilation by overriding the same variables that you would with an autoconf project. As an example, the ...
Read more >Let's Build Chuck Norris! - Part 6: Cross-compilation for Android
Those files do not exist on Android, because even if Android is based on Linux, it's still a different operating system. See the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s why I was thinking I was missing something. I generally work on windows and I didn’t hit this check previously because it skips the check on windows.
I think the check at least should verify we are cross building or not (i.e. check whether
default_profile["os"] == settings.get("os")
). In my casedefault_profile["os"]
is Linux butsettings.get("os")
is Android.At that point I think conan-package-tools could assume user have set their cross build environment correctly. Basically
_detected_compiler_override
is too early if I am setting CC and CXX through conan package dependencies.Note: I just noticed what
_detected_compiler_override
does. If I had noticed it earlier, I would have just set these variables in my ‘build.py’ for my cross compiles to something else. They don’t even have to be correct, since conan will set them for me later, during the actual build. See below.I have a ndk-toolchain conan package similar to conan-android-toolchain that sets env_info.CC and env_info.CXX, and my package requires it in its build_requirements.
in ndk-toolchain:
in package that uses ndk-toolchain for cross compile:
I’ve released a new version removing that check. I think it has become not necessary some time ago but we didn’t remove it. Thanks!