For what it's worth, we translate from pkg-config to a proper transitive CMake model at configuration time. We could do other configuration time things if context is the problem.

Yeah, it's fair to say that translation from a context-free pkg-config file to something else would be challenging without making some assumptions. But pkg-config files often make dramatic assumptions already. Like implying system library linkage and search paths, implying language runtimes, use of non portable flags, etc. I expect any solution we come up with will require some in intentional adoption on the part of some package managers.

Bret

On Fri, Oct 29, 2021, at 11:31 AM, Matthew Woehlke via SG15 wrote:
On 28/10/2021 10.40, Daniel Ruoso via SG15 wrote:
> On Wed, Oct 27, 2021, 22:32 Boris Kolpackov wrote:
>> A build system that wants to support system-installed libraries on Linux
>> will need to support pkg-config. This means that if this effort results in
>> a new format (which I believe where this is heading), such a build system
>> will now need to support both pkg-config and this new format.

People, presumably involved in pkg-config, keep saying that, but it 
seems no one wants to do the work. I'm still waiting to see something 
using pkg-config that satisfies even CMake's more basic requirements 
without jumping through hoops.

Hint: *full path to libraries*.

> pkg-config is a strict subset of what we're talking about here, so it
> should be possible to mechanically convert a new format into a pc file
> (with the subset supported by it) and to generate the file in the new
> format with all the data that could be extracted from the pc file (which
> does mean we need it to support proving only the minimal data that exists
> in the pc file).

> I think the outcome is that it's a requirement that it should be trivial to
> convert the information on any new format to and from existing formats.

I think that is doomed to fail. Pkg-config, as people expect it to work, 
is a fairly impoverished format (not too surprising considering its 
age). Converting *to* pkg-config ought to be do-able. Converting *from* 
pkg-config, especially from the sorts of pkg-config files that currently 
exist, is a much harder proposition. (For starters, you're doomed if you 
don't have access to the package's entire file listing while trying to 
perform the conversion.)

-- 
Matthew
_______________________________________________
SG15 mailing list
SG15@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/sg15