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

CXXFLAGS overrides default flags, CFLAGS doesn't #299

Closed
mglisse opened this issue Sep 21, 2024 · 0 comments · Fixed by #322
Closed

CXXFLAGS overrides default flags, CFLAGS doesn't #299

mglisse opened this issue Sep 21, 2024 · 0 comments · Fixed by #322

Comments

@mglisse
Copy link

mglisse commented Sep 21, 2024

cflags = _add_flags(cflags, 'C')
ldshared = _add_flags(ldshared, 'C')
cxxflags = os.environ.get('CXXFLAGS', cxxflags)

distutils now uses CXXFLAGS instead of CFLAGS for C++, that's good. However, it was implemented differently: while CFLAGS is appended to the default flags, CXXFLAGS replaces them. Is there a particular reason for this inconsistency? I have an application where I was setting both CFLAGS and CXXFLAGS to the same value, and was quite confused when the behavior changed with the new setuptools.

thesamesam added a commit to thesamesam/distutils that referenced this issue Dec 22, 2024
Since 2c93711, CXXFLAGS is used
as-is if set in the envionment rather than clobbered by whatever
CPython happened to be built with.

Do the same for CFLAGS: use it as-is if set in the environment, don't
prepend CPython's saved flags.

Fixes: pypa#299
thesamesam added a commit to thesamesam/distutils that referenced this issue Dec 22, 2024
Since 2c93711, CXXFLAGS is used
as-is if set in the envionment rather than clobbered by whatever
CPython happened to be built with.

Do the same for CFLAGS: use it as-is if set in the environment, don't
prepend CPython's saved flags.

Fixes: pypa#299
@jaraco jaraco closed this as completed in af7fcbb Dec 27, 2024
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

Successfully merging a pull request may close this issue.

1 participant