Open Ju1He1 opened 2 years ago
Hi @Ju1He1
It seems you are using quite old information. (For example using the docs for Conan 1.6, while we are at Conan 1.42, the former is like 3 years old now).
The cross-build model has also been updated. The modern approach doesn't use os_build
in the profile, but instead uses 2 profiles, the "build" profile and the "host" profile. You could see a short demo in this video (https://youtu.be/VzUJQw89U7o?t=3188),
It would also be good to try things without the cmake-conan
integration first, because it is possible that that integration is not very well ready to do cross-building.
Hey thx for this interesting video :) I will go with the 2 separate profiles for cross compiling.
However I still got some questions
If this all is not possible, can I tell conan just to do an export and no build. I can live with compiling the 3rd parties on each project rebuild.
Thx for your fast answers :)
@memsharded I tried the extra profile for cross building as you suggested. This worked. I'm currently working with
target_host=arm-none-eabi
standalone_toolchain=C:/toolchains/arm-none-eabi-gcc-10.2.1
cc_compiler=gcc
cxx_compiler=g++
[settings]
os=Linux
arch=armv6
compiler=gcc
compiler.version=10
compiler.libcxx=libstdc++11
build_type=Release
[env]
CONAN_CMAKE_FIND_ROOT_PATH=$standalone_toolchain/$target_host
PATH=[$standalone_toolchain/bin]
CHOST=$target_host
AR=$target_host-ar
AS=$target_host-as
RANLIB=$target_host-ranlib
LD=$target_host-ld
STRIP=$target_host-strip
CC=$target_host-$cc_compiler
CXX=$target_host-$cxx_compiler
CXXFLAGS="-I $standalone_toolchain/$target_host/include -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 --specs=nosys.spec"
However as you can see there are many hardcoded path inside this profile. However since some of these paths (like the Compiler version) are project depended, I'd like to access the project specific settings configured in CMake.
So is it possible to get the toolchain path from a CMake Variable or an environment variable?
Hey, I'd like to use conan to cross compile some 3rd parties for an embedded target with gcc-arm-none-eabi compiler (GCC 10 is used)
I've found this info https://github.com/conan-io/conan/issues/675 bit it looks a little bit outdated to me
What os_target and arch_target should i use for embedded builds. target on embedded is usually "none" but this is not in the list
I tried
However it looks like "None" is not a valid arch_target value The settings.yml currently contains only these (cross) compiling values
Is it currently possible to cross compile with gcc arm none eabi using conan, or do I have to manually apply the fix posted here https://github.com/conan-io/conan/issues/675#issuecomment-262303771
Thx for you answer :)
Edit: I did take a look at https://docs.conan.io/en/1.6/systems_cross_building/cross_building.html , especially the Windows to Raspberry PI (Linux/ARM) section but cortex M MCUs don't have arch=armv7