Sim*_*lli 5 c++ cmake shared-libraries cyclic-dependency
我正在编写一个 CMakeLists.txt 文件来构建我的 C++ 项目,该项目由
问题是,libhybris.so 依赖于 libpcre (用于正则表达式功能),所以我有以下语句:
# libhybris.so generation
add_library( libhybris
SHARED
${LIB_SOURCES} )
...
# Needed libraries
target_link_libraries( libhybris
dl
pcre
pthread
readline )
Run Code Online (Sandbox Code Playgroud)
第 3 点中的共享库之一称为 pcre.so,因此我也有以下内容:
add_library( pcre SHARED ${PCRE_SOURCES} )
...
target_link_libraries( pcre
dl
pcre
curl
pthread
readline
ffi
libhybris )
Run Code Online (Sandbox Code Playgroud)
因此,当我运行“cmake .”时,出现以下错误:
-- Configuring done
CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
"libhybris" of type SHARED_LIBRARY
depends on "pcre"
"pcre" of type SHARED_LIBRARY
depends on "libhybris"
At least one of these targets is not a STATIC_LIBRARY. Cyclic dependencies are allowed only among static libraries.
Run Code Online (Sandbox Code Playgroud)
因为 CMake 认为 libhybris.so pcre 依赖项(系统 libpcre.so)与我的 pcre.so 相同,但显然不是。
如何在不更改 pcre.so 名称的情况下解决此问题?
| 归档时间: |
|
| 查看次数: |
9505 次 |
| 最近记录: |