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

Add ability to have include_directories before CFLAGS #1020

Open
WesleyRosenblum opened this issue Mar 29, 2024 · 1 comment
Open

Add ability to have include_directories before CFLAGS #1020

WesleyRosenblum opened this issue Mar 29, 2024 · 1 comment

Comments

@WesleyRosenblum
Copy link

Currently , the contents of any CFLAGS or CXXFLAGS environment variables are added to the build cmd prior to include_directories that had been added using fn include:

cc-rs/src/lib.rs

Lines 1766 to 1770 in be62f4a

if let Ok(flags) = self.envflags(if self.cpp { "CXXFLAGS" } else { "CFLAGS" }) {
for arg in flags {
cmd.push_cc_arg(arg.into());
}
}

This can result in conflicts if the specified includes need to come prior to the CFLAGS includes.

We've worked around this by manually prepending includes to CFLAGS (see aws/s2n-tls#4338), but it would be preferable for this to be configurable in cc.

Thanks!

@NobodyXu
Copy link
Collaborator

That's definitely doable.

I would accept any PR for this.

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

2 participants