I’m encountering a CMake error when building a project with shared libraries that have cyclic dependencies:
CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
"B" of type SHARED_LIBRARY
depends on "A" (weak)
"OpenPhase" of type SHARED_LIBRARY
depends on "B" (weak)
At least one of these targets is not a STATIC_LIBRARY. Cyclic dependencies are allowed only among static libraries.
CMake Generate step failed. Build files cannot be regenerated correctly.
The error suggests that cyclic dependencies are only permitted among static libraries, but in my case, all involved libraries are shared.
Context:
- The environment is Linux, where cyclic dependencies among shared libraries are not problematic.
- Modifying the library structure or switching to static libraries is not an option at this time.
Question: Is there a way to configure CMake to bypass or “force” the generation of build files despite the cyclic dependency? If CMake cannot accommodate this, transitioning to it may not be feasible for this project.
Any help or suggestions would be greatly appreciated!