-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Feature/behavior summary
CBI currently has very limited support for emulating the behaviors of other compilers. There are some hard-coded configurations in config.py
, and users can provide unconditional definitions via the .cbi/config
file.
We should provide a mechanism that allows users to define compiler behavior more precisely (e.g., by defining the behavior of specific flags). For example, a user could define that -std={something}
defines a specific set of macros that are important to their application.
Request attributes
- Would this be a refactor of existing code?
- Does this proposal require new package dependencies?
- Would this change break backwards compatibility?
Related issues
- Implement common argument parsing with argparse #146
- Add custom argparse actions #155
- Add compiler customization schema #156
- Improve Compiler class design #164
- Add compiler definitions #168
- Fix several issues with custom argparse actions #170
- Enable
ArgumentParser
to handle custom compilers #176
Solution description
Extend the .cbi/config
schema to support the definition of additional compiler arguments.
One possibility would be to draw inspiration from argparse
, supporting syntax like:
[[compiler."c++".parser]]
flags = ["-isystem", "-I"]
dest = "include_paths"
action = "append"
[[compiler."c++".parser]]
flags = ["-include"]
dest = "includes"
action = "append"
[[compiler."c++".parser]]
flags = ["-D"]
dest = "defines"
action = "append"
...but with a limited set of supported destination
and action
strings.
Additional notes
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request