premake-core
premake-core copied to clipboard
Adds "uses" and "block" APIs
What does this PR do?
Adds the uses
and block
APIs. uses
accepts a set of strings and block
is a scoped API that accepts a name and a function. The goal of the API is to provide easy configuration reusability. The planned API behaviors are as follows:
- A
block
provides a reusable set of definitions, such aslinks
andincludeDirs
. These will allow both the project owning the block and external projects to consume the block. - A
block
is consumed via theuses
API. By using a block, the consumer will link against the project and inherit its linked projects, library directories, include directories, defines, and more. - When a
block
is consumed byuses
, it will also inherit downstream dependencies. That is to say if blockA
uses blockB
and blockB
uses blockC
, blockA
will inherit from blockC
as well.
How does this PR change Premake's behavior?
No breaking behavior.
Anything else we should know?
Addresses concerns brought up in #1346
Did you check all the boxes?
- [x] Focus on a single fix or feature; remove any unrelated formatting or code changes
- [x] Add unit tests showing fix or feature works; all tests pass
- [x] Mention any related issues (put
closes #XXXX
in comment to auto-close issue when PR is merged) - [x] Follow our coding conventions
- [x] Minimize the number of commits
- [x] Align documentation to your changes
You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!