mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
baa089903e
Depends on D36091 Differential Revision: https://phabricator.services.mozilla.com/D36092 --HG-- extra : moz-landing-system : lando
22 lines
545 B
Python
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)
|