Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Second level static library dependency does not store dependent library in rules #25

Open
ethouris opened this issue Nov 6, 2024 · 0 comments

Comments

@ethouris
Copy link
Owner

ethouris commented Nov 6, 2024

This is only problem with "rule" statement - the library itself is added to the library making command.

Actually this better be done completely different way: if a static library is a dependency of a program or a dynamic library, then all possible static libraries should be added to both the command AND the dependencies in the rule. This should work different than with dynamic libraries - for dynamic libraries it can stay with the phony target assigned to the library. For static libraries it should extract all possible static libraries very specific way:

  1. Take all dependent targets.
  2. By following whether the target is a static library, collect also all its dependent targets as well. Do it recursively for all such targets.
  3. Now that the targets are collected, reorder them to achieve the flat list in order of dependencies.
  4. From every such target get the name of the static library AND everything in their -ldflags (just like it's done for commands)
  5. Again, make sure that all library specifications are unique. Dependencies must follow requesters!
  6. All names of static libraries that are assigned to these targets must comprise the list of dependencies (NOT the target names!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant