[Qbs] Exporting Dependencies on generated files

Björn Schäpers qt-maillist at hazardy.de
Fri Nov 12 20:33:29 CET 2021


Am 04.11.2021 um 12:45 schrieb Christian Kandeler:
> On 11/4/21 11:22, Björn Schäpers wrote:
>> we have a static library which uses Protobuf, thus generates the headers, and 
>> compiles the code directly into it.
>>
>> Static Library {
>>   ...
>>   Export {
>>     Depends { name: "cpp" }
>>     Depends { name: "protobuf.cpp" }
>>     cpp.systemIncludePaths: [product.protobuf.cpp.outputDir]
>>   }
>> }
>>
>> And some products which depend on that, but qbs does not order files of the 
>> dependent products which include the generated headers after the generation 
>> of these.
>>
>> Is there a way to ideally make the files which include to depend on the 
>> header generation, or at least block all actions on the dependent product 
>> wait until the static library is build?
>
> This should work if you include "hpp" in the type of the generating product.
>
>
> Christian

Adding "hpp" as type does indeed result in the complete compilation of the 
generating product, before the using product is started. But the files were not 
recompiled if there were changes, so this only helps in the initial build.

What was I needed is also to Export cpp.treatSystemHeadersAsDependencies: true.

Regards,
Björn.



More information about the Qbs mailing list