[Qbs] Using ConanfileProbe with yocto cross compiling toolchain
chgans at gmail.com
Fri May 15 11:20:44 CEST 2020
On Fri, 15 May 2020 at 19:46, Kai Dohmen via Qbs <qbs at qt-project.org> wrote:
> I just stumbled across a scenario in which we use with multiple profiles for different cross compiling toolchains. Yocto creates a script which exports environment variables. We normally just extract the needed values from the script and set them as additional qbs profile settings.
> This leads to the problem that the ConanfileProbe just calls "conan install... -p..." without the needed environment variables. Thus when install libraries they are getting compiled with the wrong toolchain/settings.
> What is the proper way of doing this? How do I set the environment variables? Should I set the variables in the Kit?
Personal opinion: I hate yocto simply because it requires to run any
of your tool (IDE, build system) under a controlled environment.
Things might have changed a bit, eg Boot2Qt is based on yocto, and you
can use QtC with boo2qt w/o sourcing an env first.
Unfortunately i do not know the details on how they achieved that.
IMHO, using Qbs in a way that makes it heavily shell environment
dependent is going against Qbs spirit. The profile system is one of
Qbs cornerstone. So maybe you could source this env file only once,
just before setting up your profiles, and capture all the relevant
bits in your profile this way.
Just some ideas, i don't know how practical this would be.
I haven't use Yocto in ages, could you copy/paste your env file?
More information about the Qbs