diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2024-02-22 10:16:17 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2024-02-22 10:16:17 +0200 |
commit | 7459ac30aa69d6fc5a0e0d2a0050b475e7af85d6 (patch) | |
tree | 08701adaaa6cdacd0e6394a8597214a1aaec8b50 /libbuild2 | |
parent | c8810465be8237ceb3ef96e7512a4762756584ff (diff) |
Detect dependency cycles in *.export.libs
Fixes GH issue #362.
Diffstat (limited to 'libbuild2')
-rw-r--r-- | libbuild2/cc/common.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libbuild2/cc/common.cxx b/libbuild2/cc/common.cxx index 44722c4..2a8bc50 100644 --- a/libbuild2/cc/common.cxx +++ b/libbuild2/cc/common.cxx @@ -162,7 +162,12 @@ namespace build2 // Add the library to the chain. // if (self && proc_lib) + { + if (find (chain->begin (), chain->end (), &l) != chain->end ()) + fail << "dependency cycle detected involving library " << l; + chain->push_back (&l); + } // We only lookup public variables so go straight for the public // variable pool. |