Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add std/pkgconfig module #24320

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open

Add std/pkgconfig module #24320

wants to merge 1 commit into from

Conversation

ehmry
Copy link
Contributor

@ehmry ehmry commented Oct 17, 2024

A module for collecting compile-time information from pkg-config.

I've been using pkg-config with passC for years on Linux and it's worked well.

Using $PKG_CONFIG with a fallback to pkg-config is useful for cross-compiling.

@planetis-m
Copy link
Contributor

To be fair this is something that could belong in fusion...

@ehmry
Copy link
Contributor Author

ehmry commented Oct 17, 2024

If it was something that I would have to fetch an additional package for then I would continue using it as boilerplate to paste into modules.

lib/std/pkgconfig.nim Outdated Show resolved Hide resolved

from std/envvars import getEnv

proc pkgConfig*(args: string): string {.compiletime.} =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about cross platform support?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkg-config doesn't seem to have any flags for cross-compiling.

For cross-compling I would set $PKG_CONFIG_PATH to somewhere with pkg-config files for your target, which can be done by calling the compiler with putenv:PKG_CONFIG_PATH=your-cross-pkg-config-files.

@arnetheduck
Copy link
Contributor

arnetheduck commented Oct 17, 2024 via email

A module for collecting compile-time information from pkg-config.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants