Discuss about "Usage API"
After several experiments with the new API, I noticed that 'uses' are not inherited another 'uses'.
We have app, libA, libB, libC. libA uses libC, libB uses libC. app uses libA and libB. We have link error, because libC not found.
I have no problem adding another 'uses "libC"' to the app. But it may seem counterintuitive to some. In CMake, link inheritance is recursive. In premake-usage project, 'uses' are recursive.
Otherwise, the new Usage API is very good, as it seems to me.
If anyone has any suggestions, then let's discuss.
Would you be able to produce a minimum sample? By default, yes, uses are not recursive. This is intentional. However, specifying a uses in usage "PUBLIC" will ensure that it is propagated to any consumers. I'm also working on writing up a larger piece of documentation at the moment, but effectively, what you are trying to do can be done with:
project "A"
usage "INTERFACE"
links "A"
project "B"
usage "PUBLIC"
uses { "A" }
usage "INTERFACE"
links { "B" }
project "C"
uses { "B" }
I understood. I used 'uses' outside of the 'usage' block. That's why it wasn't linked. It would be necessary to reflect this point in the documentation. Thanks for the reply.
See #2438. It is an open PR that will address adding documentation.
I updated my project, which used premake-usage, and it works fine. According to my measurements, the solution generation time has been reduced by about 15-20% compared to premake-usage.
Glad to hear a reduction in generation time. This is a pretty naive implementation that I have here, so hopefully we can continue improving performance over time with it.