Skip to content

Commit

Permalink
Merge pull request #105 from kvinwang/fix69
Browse files Browse the repository at this point in the history
Do not pass "-std=c99" to cpp compiler
  • Loading branch information
kmike committed Mar 14, 2020
2 parents 7328338 + 60ab24a commit 13d5f68
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@
class build_ext_check_gcc(build_ext):
def build_extensions(self):
c = self.compiler

_compile = c._compile

def c_compile(obj, src, ext, cc_args, extra_postargs, pp_opts):
cc_args = cc_args + ['-std=c99'] if src.endswith('.c') else cc_args
return _compile(obj, src, ext, cc_args, extra_postargs, pp_opts)

if c.compiler_type == 'unix' and 'gcc' in c.compiler:
for e in self.extensions:
e.extra_compile_args=['-std=c99']
c._compile = c_compile
elif self.compiler.compiler_type == "msvc":
if sys.version_info[:2] < (3, 5):
c.include_dirs.extend(['crfsuite/win32'])
Expand Down

0 comments on commit 13d5f68

Please sign in to comment.