[Qbs] Library- and Include-Probe for msys GCC on the example of the protobuf module

Иван Комиссаров abbapoh at gmail.com
Thu Aug 5 09:45:39 CEST 2021


Sorry for the long response.

The idea is that Qbs will use custom parser of .pc files - this allows us to work with dependencies between .pc files and convert them to deps between qbs modules which is not possible via pkg-config tool API. So you don’t really need pkg-config binary to be present in the system. However, if it is present, Qbs will use its libdirs automatically. So you will have 2 options - either pass path to 32 bit pkg-config or set libdirs manually (it is also possible to have some hardcoded values in Qbs, maybe depending on the toolchain? dunno)

Ivan

> 21 июля 2021 г., в 22:55, Björn Schäpers <qt-maillist at hazardy.de> написал(а):
> 
> Thanks for the response.
> 
> This is fine for me. And yes msys provides .pc files, but that leaves me with another problem, at least when used from the QtCreator. I only have pkg-config from my 64 bit system in the path, an thus when compiling for 32 bit the wrong libraries are picked up.
> 
> Regards,
> Björn.
> 
> Am 21.07.2021 um 07:16 schrieb Иван Комиссаров:
>> You will get more feedback once I’ll be back from vacation ^^
>> 
>> Your assumption that it should work out if the box is correct.
>> 
>> However, it should not use probes, but pkg-config instead (I assume, msys provides correct .pc files).
>> 
>> I am currently working on the feature to implement this .
>> 
>> https://codereview.qt-project.org/c/qbs/qbs/+/315910
>> 
>> https://codereview.qt-project.org/c/qbs/qbs/+/350654
>> 
>> Ivan
>> 
>>> 21 июля 2021 г., в 03:07, Björn Schäpers <qt-maillist at hazardy.de> написал(а):
>>> 
>>> Hi there,
>>> 
>>> my setup is msys2 gcc in 64 and 32 bit, a from msys installed protobuf, and a self compiled qbs. The protobuf module does not find the header or the libraries, it seems the search path is just empty, and for the libraries it looks for the wrong files. It searches protobuf.lib, but the file is named libprotobuf.a.
>>> 
>>> I have prepared a patch, with which the protobuf examples compile and run: https://codereview.qt-project.org/c/qbs/qbs/+/358698 my colleagues tells me for gRPC there are some additional libraries missing, but that's another point.
>>> 
>>> There is little feedback on the patch, only that I could set the paths in my project file. Yes I could, but in my opinion it should work out of the box with a msys setup. But the wrong library names and suffixes I can not fix in my project file, or can I?
>>> 
>>> So my questions are:
>>> 1. Should it be fixed in qbs itself, or do I have to make a fork?
>>> 2. Should it be fixed in the protobuf module, or the probes itself?
>>> 
>>> Greetings,
>>> Björn.
>>> _______________________________________________
>>> Qbs mailing list
>>> Qbs at qt-project.org
>>> https://lists.qt-project.org/listinfo/qbs
> 
> 



More information about the Qbs mailing list