gecko-dev/config/system_header_util.py
Justin Wood baa089903e Bug 1559975 - Make config/ lint with 'py2' and 'py3' r=catlee
Depends on D36091

Differential Revision: https://phabricator.services.mozilla.com/D36092

--HG--
extra : moz-landing-system : lando
2019-07-08 17:30:34 +00:00

22 lines
545 B
Python

from __future__ import absolute_import
import os
def find_in_path(file, searchpath):
for dir in searchpath.split(os.pathsep):
f = os.path.join(dir, file)
if os.path.exists(f):
return f
return ''
def header_path(header, compiler):
if compiler == 'gcc':
# we use include_next on gcc
return header
elif compiler == 'msvc':
return find_in_path(header, os.environ.get('INCLUDE', ''))
else:
# hope someone notices this ...
raise NotImplementedError(compiler)