gor-gyolchanyan opened issue #13611:
I propose including pkg-config support.
Many software repositories vending C libraries have support for
pkg-configby generating a*.pcfile (during the build configuration phase, when installation paths become known), which significantly improves discoverability of the C library, as well as improves interoperability with other build systems.Feature
Including pkg-config support means producing a
wasmtime.pcfile as part of each release. Thewasmtime.pcwould be used in conjunction with thepkg-configtool to streamline C API usage and would contain all necessary information like the include path, the library path, and the library to be linked with.Benefit
- Wasmtime exposes a stable C embedding API via
wasmtime.handlibwasmtime.dylib, which at the moment aren't easy to integrate into build processes without custom environment configuration.- Build systems like SwiftPM, Meson, Autotools, CMake, and many other build systems can consume libraries through
pkg-config.Implementation
I created a separate homebrew formula that depends on the existing
wasmtimeformula and generates thewasmtime.pcfile. I was going to create a pull request for homebrew-core.git, but having the build process generate thewasmtime.pcfile seems like a better approach.Alternatives
Alternatively, the ruby code that generates the
wasmtime.pcfile inside theinstallfunction of my homebrew formula could be copied intowasmtime.rb, making the existing wasmtime homebrew formula install thewasmtime.pcfile.
gor-gyolchanyan edited issue #13611:
I propose including pkg-config support.
Many software repositories vending C libraries have support for
pkg-configby generating a*.pcfile (during the build configuration phase, when installation paths become known), which significantly improves discoverability of the C library, as well as improves interoperability with other build systems.Feature
Including pkg-config support means producing a
wasmtime.pcfile as part of each release. Thewasmtime.pcwould be used in conjunction with thepkg-configtool to streamline C API usage and would contain all necessary information like the include path, the library path, and the library to be linked with.Benefit
- Wasmtime exposes a stable C embedding API via
wasmtime.handlibwasmtime.dylib, which at the moment aren't easy to integrate into build processes without custom environment configuration.- Build systems like SwiftPM, Meson, Autotools, CMake, and many other build systems can consume libraries through
pkg-config.Implementation
I created a separate homebrew formula that depends on the existing
wasmtimeformula and generates thewasmtime.pcfile. I was going to create a pull request for homebrew-core.git, but having the build process generate thewasmtime.pcfile seems like a better approach.Alternatives
Alternatively, the ruby code that generates the
wasmtime.pcfile inside theinstallfunction of my homebrew formula could be copied intowasmtime.rb, making the existing wasmtime homebrew formula install thewasmtime.pcfile.Notes
I included the source code of my homebrew formula for reference (I tentatively named it libwasmtime for disambiguation purposes).
gor-gyolchanyan edited issue #13611:
I propose including pkg-config support.
Many software repositories vending C libraries have support for
pkg-configby generating a*.pcfile (during the build configuration phase, when installation paths become known), which significantly improves discoverability of the C library, as well as improves interoperability with other build systems.Feature
Including pkg-config support means producing a
wasmtime.pcfile as part of each release. Thewasmtime.pcwould be used in conjunction with thepkg-configtool to streamline C API usage and would contain all necessary information like the include path, the library path, and the library to be linked with.Benefit
- Wasmtime exposes a stable C embedding API via
wasmtime.handlibwasmtime.dylib, which at the moment aren't easy to integrate into build processes without custom environment configuration.- Build systems like SwiftPM, Meson, Autotools, CMake, and many others can consume libraries through
pkg-config.Implementation
I created a separate homebrew formula that depends on the existing
wasmtimeformula and generates thewasmtime.pcfile. I was going to create a pull request for homebrew-core.git, but having the build process generate thewasmtime.pcfile seems like a better approach.Here's the source code of my homebrew formula for reference (I tentatively named it libwasmtime for disambiguation purposes).
Alternatives
Alternatively, the ruby code that generates the
wasmtime.pcfile inside theinstallfunction of my homebrew formula could be copied intowasmtime.rb, making the existing wasmtime homebrew formula install thewasmtime.pcfile.
alexcrichton commented on issue #13611:
Thanks for the report, and seems reasonable to me to add, yeah. Would you be up for sending a PR for this?
gor-gyolchanyan commented on issue #13611:
I haven't contributed to wasmtime before and my knowledge of rust build process is limited, but I'll look into it and see if I can get it done. I'll ask for an extra careful code review when I'm done, because I can't vouch for how idiomatic my solution will be.
Last updated: Jul 29 2026 at 05:03 UTC