Skip to content

Commit

Permalink
Use CFLAGS if set as-is, match CXXFLAGS behavior
Browse files Browse the repository at this point in the history
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
  • Loading branch information
thesamesam committed Dec 22, 2024
1 parent 49e362c commit 97cfc07
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions distutils/sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ def customize_compiler(compiler):

ldshared = _add_flags(ldshared, 'LD')
ldcxxshared = _add_flags(ldcxxshared, 'LD')
cflags = os.environ.get('CFLAGS', cflags)
cflags = _add_flags(cflags, 'C')
ldshared = _add_flags(ldshared, 'C')
cxxflags = os.environ.get('CXXFLAGS', cxxflags)
Expand Down

0 comments on commit 97cfc07

Please sign in to comment.