Unsolved Can I have separate compilers per qt mcu module?
-
I currently have two modules in my project.
I want automotive to use mcu compiler and automotive_module to use plain qt compiler.
How should I apply it in the build step?
Thank you for answer.
-
@inusion said in Can I have separate compilers per qt mcu module?:
How should I apply it in the build step?
Simply define the compiler you want to use in the Kit.
It looks like you already have two Kits: automotive and automotive_module, so go there and define the compilers. -
thank you.
I'm new to qt, so could you elaborate on how to go to that kit and define the compiler?
For reference, the two modules you see there are one project.
-
@inusion In menu "Tools/Options.../Kits". Select a Kit and check what compiler is set, change to another compiler if needed. Compilers are defined in same dialog in "Compilers" tab.
-
thank you. But I didn't understand. The compiler can be set for each project, but I don't know how to set the compiler for each target.
-
@inusion The compiler is set for a Kit, not project.
For each target you have one Kit. To build for a target simply select the Kit for that target... -
@jsulm
As you can see below, the first kit can be run individually, but the second kit cannot be run.The first kit is in charge of the front end and the second kit is in charge of the back end, but they cannot be compiled separately.
The corresponding source is mcu automotive demo
-
@inusion If the second Kit does not work then please check it: are there any errors/warnings?
-
@jsulm
There are no errors or warnings, and if I build the entire project, both compile and build work fine.But what I want is to make the first kit work as an mcu compiler and the second kit as a desktop compiler.
-
You can compile them separately, i.e. you select the desktop kit and compile the desktop project, then select the mcu kit and compile the mcu project. However, I am not aware of a way to compile both in one go at the same time. This is not necessarily a restriction from Qt (or rather Qt Creator in this case), but from CMake. You need to teach your CMake project to use two different compilers for different (sub-)projects. I can't help you with this, though.