Skip to content

Commit

Permalink
Update _parser.py [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
pfernique committed Feb 5, 2018
1 parent c8db3e0 commit c8fb7eb
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/py/autowig/_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,28 @@ def pre_processing(asg, headers, flags, **kwargs):
else:
system = SYSTEMS[system]

if '-x c++' in cmd:
asg._language = 'c++'
elif '-x c' in cmd:
asg._language = 'c'
else:
raise ValueError('\'flags\' parameter must include the `-x` option with `c` or `c++`')

if system == 'win':
devnull = 'nul'
# compiler = 'clang'
compiler = 'clang'
elif system in ['linux', 'osx']:
devnull = '/dev/null'
# compiler = 'clang'# os.environ['GXX']
if asg._language == 'c++':
compiler = os.environ.get('GXX', 'clang')
else:
compiler = os.environ.get('GCC', 'clang')
elif system == 'osx':
devnull = '/dev/null'
if asg._language == 'c++':
compiler = os.environ.get('CLANGXX', os.environ.get('CLANG__', 'clang'))
else:
compiler = os.environ.get('CLANG', 'clang')
else:
raise Exception("unknown system")

Expand Down

0 comments on commit c8fb7eb

Please sign in to comment.