-
Notifications
You must be signed in to change notification settings - Fork 974
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 set executable path of compiler provided by [build_requires] in profile #10210
Comments
It would be good to know if you are already using the "build" and "host" profile approach (very recommended for cross-building), and it would also be good to know the consumer part, because depending on the generators and other tools that you might be using, it could work or not. In the general case, this should work, so it might be something in the consumer side. In general, specially if you are onboarding now, I'd probably recommend trying to use the new If you want to setup a small reproducible toy project in Github, with a "linaro-gcc" fake recipe, and a consumer fake recipe, that could also really help to check what could be happening. |
Yes, I am indeed using the "build" and "host" profile approach.
This system does recognise that I am crossbuilding. conanfile.txt looks like this:
I integrate with my cmake project this way:
I have been a bit reluctant to try the "virtualenv" route as I am unsure if it integrates well with clion. I do not want the developers working on the project to have to run special/magic scripts before they can build. I will try to set-up a small "working" (or rather not working) example project on github. Regards |
I start to understand. The thing is that if you are not using any virtualenv capability, then most of the responsibility falls in the build system. In order for the environment to be activated when cmake is called, there must be something there that passes the information. If the build is done inside a |
That does make sense. I was however under the impression that the cmake toolchain file genereated by the CMakeToolchain generator would do exactly that and bridge the gap between conan and my project. |
The responsibility of the At some point, it is possible that the But in any case, the "chicken and egg" problem still remains, if you are using the |
No, that's not true. CMake does not load CMAKE_TOOLCHAIN_FILE until you enable languages (usually in project()). It should be entirely possible to |
Yes, but this is because I am not sure if I understand, which flow are you proposing then for this |
Sorry, this was really just a drive-by comment: I found this while searching for anything existing before I decided to write up #10553. I was just clarifying that it is is possible to change toolchains at the top of CMakeLists.txt (before project()). In fact, you could modify the environment too, if some generator wrote a conanbuildenv.cmake that was full of But, I didn't have any specific use in mind. At least, not beyond the overall goal of opening a CMakeLists.txt in an IDE and getting the same outcome as a |
In terms of "why would one use conan_cmake_install() without conan_cmake_autodetect(), my usual case (which really has nothing to do with this issue) is to |
Hello
I am trying to cross compile my project for arm.
I have packaged the linaro gcc toolchain in a package of its own.
I have put the new linaro package in the build_requires section of my arm host profile.
But how can the linaro package "communicate" to the profile where the compiler is located so that the profile can set the "CC" variable.
I have tried setting everything in the package_info() method of the linaro package, but the information does not propagate to the profile and my project, resulting in conan/cmake trying to autodetect the compiler and thus finding my installed gcc.
In the ideal world I would like all info about where the compiler is and where the sysroot is to be located in the linaro package itself as this is the one with the knowledge. And then only let my profile or project conanfile set the compiler flags.
I fear that there are concepts within conan that I have completely misunderstood.
Help is appreciated!
Here is relevant files:
linaro conanfile.py:
Please note that the above
CC
andCXX
variables seem to have no effect.host profile:
Rgds
Klaus
The text was updated successfully, but these errors were encountered: