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 Cflags.private to support static linking on Windows #162

Open
kmilos opened this issue Jan 10, 2024 · 6 comments
Open

Add Cflags.private to support static linking on Windows #162

kmilos opened this issue Jan 10, 2024 · 6 comments

Comments

@kmilos
Copy link

kmilos commented Jan 10, 2024

Cflags.private: -UINI_SHARED_LIB is needed to support both shared and static linking on Windows with a single .pc file.

See e.g. https://stackoverflow.com/a/66079443

@neheb
Copy link
Contributor

neheb commented Aug 11, 2024

@eli-schwartz any comment on this? I don't see support for this in meson.

@Tachi107
Copy link
Contributor

Is this guaranteed to work? What if Cflags.private get passed after Cflags?

@kmilos
Copy link
Author

kmilos commented Feb 28, 2025

What if Cflags.private get passed after Cflags?

That's the whole point, it doesn't work otherwise...

W/ the patched MSYS2 package:

$ pkgconf --cflags --static inih
-DINI_SHARED_LIB -UINI_SHARED_LIB

@Tachi107
Copy link
Contributor

Tachi107 commented Feb 28, 2025 via email

@kmilos
Copy link
Author

kmilos commented Feb 28, 2025

Cflags.private is not a documented feature, and is AFAIK only implemented (and in this particular order) by pkgconf [1], and not by pkg-config. That's ok though, as this is of interest only for Windows DLLs vs static libs, and on Windows dev environnements mostly/exclusively pkgconf is available/used (MSYS2, vcpkg, etc.).

[1] https://www.msys2.org/docs/pkgconfig/#cflagsprivate-static-libraries

@Tachi107
Copy link
Contributor

Tachi107 commented Mar 1, 2025 via email

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

No branches or pull requests

3 participants