Skip to content

Commit

Permalink
Update _parser.py for Windows [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
pfernique committed Feb 1, 2018
1 parent 1ba7f56 commit b87d16e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/py/autowig/_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ def pre_processing(asg, headers, flags, **kwargs):

if '-x c++' in cmd:
asg._language = 'c++'
s = subprocess.Popen([os.environ.get('CXX', 'clang'), '-x', 'c++', '-v', '-E', devnull],
s = subprocess.Popen(['clang', '-x', 'c++', '-v', '-E', devnull],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
elif '-x c' in cmd:
asg._language = 'c'
s = subprocess.Popen([os.environ.get('CC', 'clang'), '-x', 'c', '-v', '-E', devnull],
s = subprocess.Popen(['clang', '-x', 'c', '-v', '-E', devnull],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
else:
raise ValueError('\'flags\' parameter must include the `-x` option with `c` or `c++`')
Expand All @@ -158,6 +158,13 @@ def pre_processing(asg, headers, flags, **kwargs):
for sysinclude in sysincludes:
asg.add_directory(sysinclude).is_searchpath = True

if system == 'win':
if '-fno-exceptions' not in flags and '-fexceptions' not in flags:
flags.append('-fexceptions')

if '-fno-cxx-exceptions' not in flags and '-fcxx-exceptions' not in flags:
flags.append('-fcxx-exceptions')

if '::' not in asg._nodes:
asg._nodes['::'] = dict(_proxy = NamespaceProxy)
if '::' not in asg._syntax_edges:
Expand Down

0 comments on commit b87d16e

Please sign in to comment.