vector-of-bool / bpt

A C++ tool for a new decade
https://bpt.pizza
Mozilla Public License 2.0
295 stars 14 forks source link

Reject cyclic dependencies #87

Closed Quincunx271 closed 3 years ago

Quincunx271 commented 3 years ago

Draft PR to detect cyclic dependencies (uses and test_uses).

Fixes #85 (or it will once I finish this)

Quincunx271 commented 3 years ago

On further reflection, I don't think cyclic dependencies in test_uses is a thing. Tests are separate from the lib, so it can be viewed as a separate target (e.g. mylib/mylib and mylib/mylib.test), and nothing can depend on the test target, so as long as the uses are cycle free, the tests should be too.

Quincunx271 commented 3 years ago

This currently doesn't do anything with links. How does links work?

vector-of-bool commented 3 years ago

How does links work?

"I'm not sure it does" lol. I don't believe I have any test cases that exercise it...

It is a not-very-thoroughly-explored idea to allow dependee libraries be linked into a depender library, but the headers of the dependee are not available during compilation of the depender. Analogous to CMake's $<LINK_ONLY:some::target> generator expression. I'm honestly not entirely sure of the utility of such a feature. It may require future discussion.

Quincunx271 commented 3 years ago

No problem. I addressed the concerns and did a little more cleaning up as well.