8 DIR_OF_THIS_SCRIPT = os.path.abspath( os.path.dirname( __file__ ) )
20 '-isystem',
'/usr/include/clang/7/include',
26 SOURCE_EXTENSIONS = [
'.cpp',
'.cxx',
'.cc',
'.c',
'.m',
'.mm' ]
33 if not working_directory:
36 make_next_absolute =
False 37 path_flags = [
'-isystem',
'-I',
'-iquote',
'--sysroot=' ]
40 if make_next_absolute:
41 make_next_absolute =
False 42 if not flag.startswith(
'/' ):
43 new_flag = os.path.join( working_directory, flag )
44 for path_flag
in path_flags:
46 make_next_absolute =
True 48 if flag.startswith( path_flag ):
49 path = flag[ len( path_flag ): ]
50 new_flag = path_flag + os.path.join( working_directory, path )
53 new_flags.append( new_flag )
70 extension = os.path.splitext( filename )[ 1 ]
71 return extension
in [
'.h',
'.hxx',
'.hpp',
'.hh' ]
75 basename = os.path.splitext( filename )[ 0 ]
76 for extension
in SOURCE_EXTENSIONS:
77 replacement_file = basename + extension
78 if os.path.exists( replacement_file ):
79 return replacement_file
84 if kwargs[
'language' ] ==
'cfamily':
88 'include_paths_relative_to_dir': DIR_OF_THIS_SCRIPT,
89 'override_filename': filename