def set_backend(self) -> None:
    if (self.backend is not None):
        return
    backend = self.coredata.get_option(OptionKey('backend'))
    from ..backend import backends
    self.backend = backends.get_backend_from_name(backend, self.build, self)
    if (self.backend is None):
        raise InterpreterException(f'Unknown backend "{backend}".')
    if (backend != self.backend.name):
        if self.backend.name.startswith('vs'):
            mlog.log('Auto detected Visual Studio backend:', mlog.bold(self.backend.name))
        self.coredata.set_option(OptionKey('backend'), self.backend.name)
    if self.environment.first_invocation:
        self.coredata.init_backend_options(backend)
    options = {k: v for (k, v) in self.environment.options.items() if k.is_backend()}
    self.coredata.set_options(options)
def set_backend(self) -> None:
    if (self.backend is not None):
        return
    backend = self.coredata.get_option(OptionKey('backend'))
    from ..backend import backends
    self.backend = backends.get_backend_from_name(backend, self.build, self)
    if (self.backend is None):
        raise InterpreterException(f'Unknown backend "{backend}".')
    if (backend != self.backend.name):
        if self.backend.name.startswith('vs'):
            mlog.log('Auto detected Visual Studio backend:', mlog.bold(self.backend.name))
        self.coredata.set_option(OptionKey('backend'), self.backend.name)
    if self.environment.first_invocation:
        self.coredata.init_backend_options(backend)
    options = {k: v for (k, v) in self.environment.options.items() if k.is_backend()}
    self.coredata.set_options(options)