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
Feature/toolchain cmake cross #9115
Feature/toolchain cmake cross #9115
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
- Missing docs
- I'm wondering if we should add more
conf
entries for the rest of the typical stuff that CMake uses in a toolchain file. How would be the alternative for the user without modifying the recipe ( toolchain blocks ) ?
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_SYSROOT /home/devel/rasp-pi-rootfs)
set(CMAKE_STAGING_PREFIX /home/devel/stage)
set(tools /home/devel/gcc-4.7-linaro-rpi-gnueabihf)
set(CMAKE_C_COMPILER ${tools}/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER ${tools}/bin/arm-linux-gnueabihf-g++)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
Co-authored-by: Luis Martinez de Bartolome Izquierdo <lasote@gmail.com>
It is possible to directly inject a complete toolchain, with Regarding the |
I just saw this PR, and I wanted to give some feedback. We're currently using some dirty hacks to induce the correct Toolchain files for cross builds.
But this toolchain file is usually present in the docker images which run the build, back then we didn't find a better solution. Also it's nice that Conan will now offer to generate these toolchains (or induce variables in the generic toolchain), however from my experience, (real life) cmake toolchain files for cross compilation go beyond just setting sysroot and the compilers, so it might be hard for Conan to generate them correctly. If profiles could reference existing CMake toolchain files (e.g. don't know where they could be stored, ideally with/next to the profile), and if these existing toolchains would be induced to the one that Conan generates, or (if the user doesn't use the toolchain generator, if Conan could provide a path to the specified toolchain in the profile), that would be extremly useful and beneficial. |
If I understood correctly, I think that this is already available in 1.37 in the
Does this help? Is this the feature that you want? |
@memsharded about the paths of the toolchain files, they are usually tightly coupled to proflex, e.g. one toolchain file per profile, so it would be cool to have it there. Alternative could be a |
We also introduced the possibility for |
Oh that's very good to know and very handy! Thanks for the info! |
:) Keep in mind that it is experimental, we are doing a ton of work in this, and this is expected to evolve. Feedback very welcome of course! |
* Added --conf argument as new possible argument for conan create, install, export_dpkg, etc * Fixed bad positional argument * Added TODOs and conf merge * Added several tests for conf cli option * Simplified integration test * Added more tests * Added more complete integration test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget the docs and explain that tools.cmake.cmaketoolchain:user_toolchain
invalidates the cross build block
Changelog: Feature: Initial cross-build support in
CMakeToolchain
with definition ofCMAKE_SYSTEM_NAME
,CMAKE_SYSTEM_PROCESSOR
andCMAKE_SYSTEM_VERSION
, deduced fromself.settings_build
(only using the 2 profiles) and from new[conf]
items.Docs: conan-io/docs#2140
Close #9072