Skip to content

Commit

Permalink
Merge pull request #322 from thesamesam/cflags
Browse files Browse the repository at this point in the history
Use CFLAGS if set as-is, match CXXFLAGS behavior
  • Loading branch information
jaraco authored Dec 27, 2024
2 parents a8eec20 + 630551a commit c97a3db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 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
6 changes: 4 additions & 2 deletions distutils/tests/test_sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@ def test_customize_compiler(self):
comp = self.customize_compiler()
assert comp.exes['archiver'] == 'env_ar --env-arflags'
assert comp.exes['preprocessor'] == 'env_cpp --env-cppflags'
assert comp.exes['compiler'] == 'env_cc --sc-cflags --env-cflags --env-cppflags'
assert (
comp.exes['compiler'] == 'env_cc --env-cflags --env-cflags --env-cppflags'
)
assert comp.exes['compiler_so'] == (
'env_cc --sc-cflags --env-cflags --env-cppflags --sc-ccshared'
'env_cc --env-cflags --env-cflags --env-cppflags --sc-ccshared'
)
assert (
comp.exes['compiler_cxx']
Expand Down

0 comments on commit c97a3db

Please sign in to comment.