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 environment variable in "cc-flags" & "cc-link-flags" #555

Open
1 task
tonyfettes opened this issue Jan 10, 2025 · 0 comments
Open
1 task

Support environment variable in "cc-flags" & "cc-link-flags" #555

tonyfettes opened this issue Jan 10, 2025 · 0 comments

Comments

@tonyfettes
Copy link
Contributor

Feature Request

Note: While we appreciate all feature requests, please understand that not all requests can be accepted. Providing detailed information will help us better evaluate your suggestion.

Summary

Support usage of environment variables in "cc-flags" & "cc-link-flags" field.

Motivation

For native backend programs, I want my problem to be able to compile on linux & macOS, which sometimes may link to different system libraries, or the same library but located at different place.

However, a proper multi-platform support is somewhat complex and relies on us to maintain a list of supported platform. By using environment variables, we can let users to handle the complexity of the platforms they will be using.

Detailed Description

I would be able to write:

{
  "link": {
    "native": {
      "cc": "gcc",
      "cc-flags": "${CFLAGS}"
      "cc-link-flags": "${LDFLAGS}"
    }
  }
}

And moon will read the two environment variables from its environment, and interpolate them into the flags string before calling moonc.

Related Issues

Checklist

  • I have added all necessary details to make it easy for the maintainers to understand my request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant