@permittedKwargs({'name', 'no_builtin_args', 'include_directories', 'args', 'dependencies'})
def compiles_method(self, args, kwargs):
    if (len(args) != 1):
        raise InterpreterException('compiles method takes exactly one argument.')
    code = args[0]
    if isinstance(code, mesonlib.File):
        code = mesonlib.File.from_absolute_file(code.rel_to_builddir(self.environment.source_dir))
    elif (not isinstance(code, str)):
        raise InvalidArguments('Argument must be string or file.')
    testname = kwargs.get('name', '')
    if (not isinstance(testname, str)):
        raise InterpreterException('Testname argument must be a string.')
    extra_args = functools.partial(self.determine_args, kwargs)
    (deps, msg) = self.determine_dependencies(kwargs, endl=None)
    (result, cached) = self.compiler.compiles(code, self.environment, extra_args=extra_args, dependencies=deps)
    if (len(testname) > 0):
        if result:
            h = mlog.green('YES')
        else:
            h = mlog.red('NO')
        cached = (mlog.blue('(cached)') if cached else '')
        mlog.log('Checking if', mlog.bold(testname, True), msg, 'compiles:', h, cached)
    return result
@permittedKwargs({'name', 'no_builtin_args', 'include_directories', 'args', 'dependencies'})
def compiles_method(self, args, kwargs):
    if (len(args) != 1):
        raise InterpreterException('compiles method takes exactly one argument.')
    code = args[0]
    if isinstance(code, mesonlib.File):
        code = mesonlib.File.from_absolute_file(code.rel_to_builddir(self.environment.source_dir))
    elif (not isinstance(code, str)):
        raise InvalidArguments('Argument must be string or file.')
    testname = kwargs.get('name', )
    if (not isinstance(testname, str)):
        raise InterpreterException('Testname argument must be a string.')
    extra_args = functools.partial(self.determine_args, kwargs)
    (deps, msg) = self.determine_dependencies(kwargs, endl=None)
    (result, cached) = self.compiler.compiles(code, self.environment, extra_args=extra_args, dependencies=deps)
    if (len(testname) > 0):
        if result:
            h = mlog.green('YES')
        else:
            h = mlog.red('NO')
        cached = (mlog.blue('(cached)') if cached else )
        mlog.log('Checking if', mlog.bold(testname, True), msg, 'compiles:', h, cached)
    return result