diff options
author | Jose Fonseca <jfonseca@vmware.com> | 2016-05-18 11:00:03 +0100 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2016-05-18 11:00:03 +0100 |
commit | fe66fc08bdc5b9bc9b5acb04ca19122650314656 (patch) | |
tree | de388bbe1d8738835926b0a34c424021f3418283 /specs | |
parent | 2e29588754727a264bcfa4c2c27df59239c97f04 (diff) |
specs/scripts: Make cxx2api agnostic to MinGW compiler version.
Diffstat (limited to 'specs')
-rwxr-xr-x | specs/scripts/cxx2api.py | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/specs/scripts/cxx2api.py b/specs/scripts/cxx2api.py index 6a979345..fa9a9d6c 100755 --- a/specs/scripts/cxx2api.py +++ b/specs/scripts/cxx2api.py @@ -359,37 +359,21 @@ def main(): winsdk = True if winsdk: # Set up Clang compiler flags to use MinGW runtime - if 0: - # XXX: This doesn't work - # http://stackoverflow.com/a/19839946 - p = subprocess.Popen( - ["x86_64-w64-mingw32-g++", "-x", "c++", "-E", "-Wp,-v", '-', '-fsyntax-only'], - stdin = open(os.devnull, 'rt'), - stdout = open(os.devnull, 'wt'), - stderr=subprocess.PIPE) - includes.append('/usr/share/castxml/clang/include') - for line in p.stderr: - if line.startswith(' '): - include = line.strip() - if os.path.isdir(include): - includes.append(os.path.normpath(include)) - elif 0: - # XXX: This matches what wclang does, but doensn't work neither - cxxflags += [ - "-target", "x86_64-w64-mingw32", - "-nostdinc", - "-isystem", "/usr/lib/clang/3.6.0/include", - "-isystem", "/usr/x86_64-w64-mingw32/include", - "-isystem", "/usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++", - "-isystem", "/usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++/x86_64-w64-mingw32", - ] - else: - # This works somehow, but seems brittle - includes += [ - '/usr/x86_64-w64-mingw32/include', - '/usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++', - '/usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++/x86_64-w64-mingw32', - ] + # http://stackoverflow.com/a/19839946 + p = subprocess.Popen( + ["x86_64-w64-mingw32-g++", "-x", "c++", "-E", "-Wp,-v", '-', '-fsyntax-only'], + stdin=open(os.devnull, 'rt'), + stdout=open(os.devnull, 'wt'), + stderr=subprocess.PIPE) + includes.append('/usr/share/castxml/clang/include') + for line in p.stderr: + if line.startswith(' '): + include = line.strip() + if os.path.isdir(include): + if os.path.exists(os.path.join(include, 'ia32intrin.h')): + # XXX: We must use Clang's intrinsic headers + continue + includes.append(os.path.normpath(include)) winver = 0x0602 |