I'm tying to compile a project with a CMakeList and pkg-config tool
Problem : dependencies using pkg-config are unresolved
'pkg-config --list-al' => all the dependencies listed
'emconfigure pkg-config --list-all' => All my dependencies are missing
Cannot find a documentation concerning pkg-config usage using emconfigure
Am I missing something ? Or is it an issue ?
I am having this problem too, has someone that has experienced this issue or knows what to do point us in the right direction?
It is a sandbox... I can't find documentation how to import emscripten ports so pkg-config will find them. Or to compile libraries using emscripten and deploy them where emconfigure pkg-config can find them.
The emscripten ports don't actually 'install' a library in a way that pkg-config will recognize (they create a .bc bitcode library in-place in the source checkout), so you may need to manually build the library and make install it into a local prefix to get the .pc files installed.
You'll then have to manually set PKG_CONFIG_PATH in the environment; with autoconf-like builds you can do that something like this (from a build script in my ogv.js project):
emconfigure ../../../libskeleton/configure \
--prefix="$dir/build/js/root" \
PKG_CONFIG_PATH="$dir/build/js/root/lib/pkgconfig" \
--disable-shared
The main thing to remember is that PKG_CONFIG_PATH should point into the lib/pkgconfig subdir under the installation prefix you put the libraries in, not just the root of the prefix.
See compileOggJs.sh and compileSkeletonJs.sh from the ogv.js build scripts for examples of installing a library and then of using it with the set path.
Hopefully that helps!
Probably the ports could be extended to create a suitable .pc file and set PKG_CONFIG_PATH in emmake and emconfigure... this could even specify the -s USE_BLAH special params that emcc uses in place of manual linking/include path setup.
If folks think that would be useful, I might look into a patch for that later.
Those examples are very helpful. Maybe it be added to https://emscripten.org/docs/getting_started/Tutorial.html? But as long as there is an example, that suffices for me! Thank you!
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.
Most helpful comment
The emscripten ports don't actually 'install' a library in a way that pkg-config will recognize (they create a
.bcbitcode library in-place in the source checkout), so you may need to manually build the library andmake installit into a local prefix to get the.pcfiles installed.You'll then have to manually set
PKG_CONFIG_PATHin the environment; with autoconf-like builds you can do that something like this (from a build script in my ogv.js project):The main thing to remember is that
PKG_CONFIG_PATHshould point into thelib/pkgconfigsubdir under the installation prefix you put the libraries in, not just the root of the prefix.See compileOggJs.sh and compileSkeletonJs.sh from the ogv.js build scripts for examples of installing a library and then of using it with the set path.
Hopefully that helps!
Probably the ports could be extended to create a suitable
.pcfile and setPKG_CONFIG_PATHinemmakeandemconfigure... this could even specify the-s USE_BLAHspecial params thatemccuses in place of manual linking/include path setup.If folks think that would be useful, I might look into a patch for that later.