# Forcing build for circular dependent dynamic libraries

**URL:** https://discourse.cmake.org/t/forcing-build-for-circular-dependent-dynamic-libraries/7052
**Category:** Usage
**Tags:** os:linux, gen:makefiles
**Created:** [December 12, 2022, 12:52pm UTC](https://discourse.cmake.org/t/forcing-build-for-circular-dependent-dynamic-libraries/7052 "2022-12-12T12:52:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sda](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/41988e/32.png) [@sda](https://discourse.cmake.org/u/sda)
#### Post date: [December 12, 2022, 12:52pm UTC](https://discourse.cmake.org/t/forcing-build-for-circular-dependent-dynamic-libraries/7052/1 "2022-12-12T12:52:47Z")

</div>

Hello,

I have a circular dependency problem within libraries in a huge project. We are compiling for Linux so circular dependencies in dynamic libraries are not an issue. Is there a way to force cmake to ignore this circular dependency and build it anyway ?

I know the ideal solution would be to eliminate this dependency, but it is not feasible at the time.

Example:

```auto
CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
  "libA" of type SHARED_LIBRARY
    depends on "libB" (weak)
  "libB" of type SHARED_LIBRARY
    depends on "libA" (weak)
At least one of these targets is not a STATIC_LIBRARY. Cyclic dependencies are allowed only among static libraries.

```

Kind regards,

Simon

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 12, 2022, 7:13pm UTC](https://discourse.cmake.org/t/forcing-build-for-circular-dependent-dynamic-libraries/7052/2 "2022-12-12T19:13:56Z")

</div>

> [@sda](#):
>
> Is there a way to force cmake to ignore this circular dependency and build it anyway ?

Not with shared libraries, no. Each needs the other to link (and CMake doesn’t model things like `--unresolved-symbols=ignore-in-shared-libs` to be able to represent such an allowance).
