def determine_args(self, kwargs, mode='link'):
    nobuiltins = kwargs.get('no_builtin_args', False)
    if (not isinstance(nobuiltins, bool)):
        raise InterpreterException('Type of no_builtin_args not a boolean.')
    args = []
    incdirs = extract_as_list(kwargs, 'include_directories')
    for i in incdirs:
        if (not isinstance(i, IncludeDirsHolder)):
            raise InterpreterException('Include directories argument must be an include_directories object.')
        for idir in i.held_object.get_incdirs():
            idir = os.path.join(self.environment.get_source_dir(), i.held_object.get_curdir(), idir)
            args += self.compiler.get_include_args(idir, False)
    if (not nobuiltins):
        for_machine = Interpreter.machine_from_native_kwarg(kwargs)
        opts = self.environment.coredata.compiler_options[for_machine][self.compiler.language]
        args += self.compiler.get_option_compile_args(opts)
        if (mode == 'link'):
            args += self.compiler.get_option_link_args(opts)
    args += mesonlib.stringlistify(kwargs.get('args', []))
    return args
def determine_args(self, kwargs, mode='link'):
    nobuiltins = kwargs.get('no_builtin_args', False)
    if (not isinstance(nobuiltins, bool)):
        raise InterpreterException('Type of no_builtin_args not a boolean.')
    args = []
    incdirs = extract_as_list(kwargs, 'include_directories')
    for i in incdirs:
        if (not isinstance(i, IncludeDirsHolder)):
            raise InterpreterException('Include directories argument must be an include_directories object.')
        for idir in i.held_object.get_incdirs():
            idir = os.path.join(self.environment.get_source_dir(), i.held_object.get_curdir(), idir)
            args += self.compiler.get_include_args(idir, False)
    if (not nobuiltins):
        for_machine = Interpreter.machine_from_native_kwarg(kwargs)
        opts = self.environment.coredata.compiler_options[for_machine][self.compiler.language]
        args += self.compiler.get_option_compile_args(opts)
        if (mode == 'link'):
            args += self.compiler.get_option_link_args(opts)
    args += mesonlib.stringlistify(kwargs.get('args', []))
    return args