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

Adding to a CompositeBuilder #12

Open
mwichmann opened this issue May 23, 2022 · 0 comments
Open

Adding to a CompositeBuilder #12

mwichmann opened this issue May 23, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@mwichmann
Copy link
Contributor

mwichmann commented May 23, 2022

If you want to write a tool to help taking sources of a new type, but that will produce a file type that SCons already has a builder for, the procedure is somewhat different than just writing a builder. As an example of a core tool that does this, swig takes interface files (.i) and can generate C/C++ files (as well as Java). That means it needs to hook into the existing CFile, CXXFile and Java builders, which are of type CompositeBuilder. A CompositeBuilder has add_action and add_emitter methods, and a suffix attribute, and SCons has convenience methods for obtaining the existing builder instance so those methods can be called on it. However, all of this stuff is set up so while it's easily available to internal tools (in SCons/Tool), there's no description of how to do this in a user-written tool. Even the API docs are quite lacking - some of the important stuff is in comments rather than docstrings and thus not picked up by Sphinx, and some of the convenience methods like createJavaFileBuilder have no docstring at all.

Proposing that a recipe in the cookbook might be useful.

@mwichmann mwichmann added the enhancement New feature or request label Jul 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant