[英]Emconfigure pkg-config dependencies unresolved / Emscripten
Tying to compile a project using Emscripten with a CMakeList and pkg-config tool结合使用 Emscripten 和 CMakeList 和 pkg-config 工具编译项目
Problem : dependencies using pkg-config are unresolved问题:使用 pkg-config 的依赖项未解决
Using :使用 :
cmake .
Works prefectly.完美运行。
Using emscripten :使用 emscripten :
emconfigure cmake .
The dependencies of the project are unresolved for some reasons.
由于某些原因,项目的依赖项未解决。
Been investigating and found out Emscripten is using his own pkg-config search path to resolved dependencies / using emconfigure :一直在调查并发现 Emscripten 正在使用他自己的 pkg-config 搜索路径来解析依赖项/使用 emconfigure :
emconfigure pkg-config --list-all
Does not list all the libs available through the classic =>不列出通过经典可用的所有库 =>
pkg-config --list-all
I'm probably missing something there.我可能在那里遗漏了一些东西。
Is there a way of forcing emscripten to use the global pkg-config system ?有没有办法强制 emscripten 使用全局 pkg-config 系统?
Edit : Is it needed to compile dependencies first into Emscripten ?编辑:是否需要先将依赖项编译到 Emscripten 中?
I came across a similar issue where a library I was using was calling pkg_check_modules(GSL gsl)
.我遇到了一个类似的问题,我使用的库正在调用
pkg_check_modules(GSL gsl)
。 I was able to fix issues with eg find_package(DoubleConversion REQUIRED)
by providing cmake args我能够通过提供 cmake args 来解决例如
find_package(DoubleConversion REQUIRED)
的问题
-DDoubleConversion_LIBRARY:FILEPATH=/home/myuser/code/double-conversion/libdouble-conversion.a -DDoubleConversion_INCLUDE_DIR:PATH=/home/myuser/code/double-conversion/double-conversion
to the cmake call but when I tried to do something similar with the GSL libraries, defining GSL_INCLUDE_DIR and GSL_LIBRARY they couldn't be found and I got errors about headers missing in the make
call.到 cmake 调用,但是当我尝试对 GSL 库做类似的事情时,定义 GSL_INCLUDE_DIR 和 GSL_LIBRARY 找不到它们,并且我收到了关于
make
调用中缺少标头的错误。
What I realized from the docs for PKG_CONFIG_USE_CMAKE_PREFIX_PATH is that (theoretically) if I just use a single arg -DCMAKE_PREFIX_PATH="${LIBS_DIR}/double-conversion;${LIBS_DIR}/gsl"
then I shouldn't have to find the library path and include path for each library and I don't need to care whether the packages were found using find_package or pkg_check_modules.我从PKG_CONFIG_USE_CMAKE_PREFIX_PATH的文档中意识到(理论上)如果我只使用一个 arg
-DCMAKE_PREFIX_PATH="${LIBS_DIR}/double-conversion;${LIBS_DIR}/gsl"
那么我不应该找到图书馆每个库的路径和包含路径,我不需要关心是否使用 find_package 或 pkg_check_modules 找到了这些包。 However, it does not seem to be a working replacement for the args I used for DoubleConversion nor does it provide me with a way of telling pkg_check_modules where to look for me GSL library.但是,它似乎不是我用于 DoubleConversion 的 args 的有效替代品,也没有为我提供一种告诉 pkg_check_modules 在哪里查找 GSL 库的方法。 Perhaps cmake is too opinionated in where it expects include headers and libs.
也许 cmake 在它期望包含头文件和库的地方过于固执己见。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.