@ -112,6 +112,15 @@ def parse_args(args):
action = ' store ' ,
action = ' store ' ,
default = ' .iwyu_ignore ' ,
default = ' .iwyu_ignore ' ,
)
)
parser . add_argument (
' -I ' ,
' --include ' ,
dest = ' include_dirs ' ,
metavar = ' <dir> ' ,
help =
""" Add <dir> to the list of directories that will be searched for header files. """ ,
action = ' append ' ,
)
parser . add_argument (
parser . add_argument (
' targets ' ,
' targets ' ,
metavar = " <target> " ,
metavar = " <target> " ,
@ -256,6 +265,8 @@ def main():
]
]
# Include plugin source dirs for plugins that depend on other plugins:
# Include plugin source dirs for plugins that depend on other plugins:
includes + = glob . glob ( os . path . join ( kaleidoscope_dir , ' plugins ' , ' * ' , ' src ' ) )
includes + = glob . glob ( os . path . join ( kaleidoscope_dir , ' plugins ' , ' * ' , ' src ' ) )
# Include dirs specified on the command line:
includes + = map ( os . path . abspath , opts . include_dirs )
clang_opts + = [ ' -I ' + _ for _ in includes ]
clang_opts + = [ ' -I ' + _ for _ in includes ]
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------