Skip to content

configure_extension doesn't handle packages with version specified #65

@Youw

Description

@Youw

When using libs or cflags functions like:

pkgconfig.cflags('libusb-1.0 >= 1.0.9')

The package with version is handled correctly.

But if I try to use it with configure_extension:

pkgconfig.configure_extension(hid, 'libusb-1.0 >= 1.0.9')

due to split being used to handle multiple packages - it is incorrectly being threated as 3 different packages: libusb-1.0, >= and 1.0.9. (Naturally if fails to find the >= package).

Avoiding spaces is not an option as it is an invalid pkg-config syntax.


The ultimate fix would be to use list of strings as an argument, instead of a single string, where each element of a list is a single package to be an argument to pkg-config (to be quoted with ' before passing to pkg-config commend), but that would break API/backward-compatibility.


My workaround is to re-implement my own copy of configure_extension.
Don't see a feasible workaround for now, as pkgconfig doesn't allow passing extra options, like --msvc-syntax (#38).
Probably just going to lose the version information, which is unfortunate.
Had make my own implementation instead of using pkgconfig package to preserve the version requirement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions