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

Support custom compiler arguments #145

Open
2 of 6 tasks
Pennycook opened this issue Dec 19, 2024 · 0 comments
Open
2 of 6 tasks

Support custom compiler arguments #145

Pennycook opened this issue Dec 19, 2024 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@Pennycook
Copy link
Contributor

Pennycook commented Dec 19, 2024

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

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

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