bytecodealliance / wasm-micro-runtime

WebAssembly Micro Runtime (WAMR)
Apache License 2.0
4.96k stars 624 forks source link

Generate pkg-config for the project #1681

Open phated opened 2 years ago

phated commented 2 years ago

While trying to write bindings for this project, I've discovered that WAMR needs various flags. For example, it always needs -lpthread or -liphlpapi -luserenv -luv_a when building with WAMR_BUILD_LIBC_UVWASI.

I noticed that libuv already provides a list of these flags for itself via pkg-config and I was hoping that WAMR could provide a complete list of these flags based on build configuration and platform.

lum1n0us commented 2 years ago

Thanks. It is a good suggestion. We will take a look and see what we can do.

haasn commented 2 years ago

+1 on this. Supplying a proper .pc file is a near-requirement to be able to use WAMR effectively from within C/C++ projects on Linux.

I would like to try using WAMR in my own project, but it seems like the only currently intended way of embedding it is to integrated it directly into a cmake-based build system. But my project not only does not use cmake (it's meson-based), but this also makes WAMR very difficult to properly package for dynamic linking.

lum1n0us commented 1 year ago

I am trying to imagine "how to properly integrate WAMR into a project which is not use cmake". Does it like?

behdad commented 1 year ago

I've also stumbled on this. Specially if WAMR is built with llvm I need to pass -lLLVM-15 currently. I don't know how to link to the included LLVM, since that doesn't seem to be installed by cmake. If I can be advised of that I can give it a try to add a pkg-config file.