def __init__(self, build, backend=None, subproject='', subdir='', subproject_dir='subprojects', modules=None, default_project_options=None, mock=False, ast=None):
    super().__init__(build.environment.get_source_dir(), subdir, subproject)
    self.an_unpicklable_object = mesonlib.an_unpicklable_object
    self.build = build
    self.environment = build.environment
    self.coredata = self.environment.get_coredata()
    self.backend = backend
    self.summary = {}
    if (modules is None):
        self.modules = {}
    else:
        self.modules = modules
    self.subproject_directory_name = subdir.split(os.path.sep)[(- 1)]
    self.subproject_dir = subproject_dir
    self.option_file = os.path.join(self.source_root, self.subdir, 'meson_options.txt')
    if ((not mock) and (ast is None)):
        self.load_root_meson_file()
        self.sanity_check_ast()
    elif (ast is not None):
        self.ast = ast
        self.sanity_check_ast()
    self.builtin.update({'meson': MesonMain(build, self)})
    self.generators = []
    self.visited_subdirs = {}
    self.project_args_frozen = False
    self.global_args_frozen = False
    self.subprojects = {}
    self.subproject_stack = []
    self.configure_file_outputs = {}
    if default_project_options:
        self.default_project_options = default_project_options.copy()
    else:
        self.default_project_options = {}
    self.project_default_options = {}
    self.build_func_dict()
    self.build_def_files = [os.path.join(self.subdir, environment.build_filename)]
    if (not mock):
        self.parse_project()
    self._redetect_machines()
def __init__(self, build, backend=None, subproject=, subdir=, subproject_dir='subprojects', modules=None, default_project_options=None, mock=False, ast=None):
    super().__init__(build.environment.get_source_dir(), subdir, subproject)
    self.an_unpicklable_object = mesonlib.an_unpicklable_object
    self.build = build
    self.environment = build.environment
    self.coredata = self.environment.get_coredata()
    self.backend = backend
    self.summary = {}
    if (modules is None):
        self.modules = {}
    else:
        self.modules = modules
    self.subproject_directory_name = subdir.split(os.path.sep)[(- 1)]
    self.subproject_dir = subproject_dir
    self.option_file = os.path.join(self.source_root, self.subdir, 'meson_options.txt')
    if ((not mock) and (ast is None)):
        self.load_root_meson_file()
        self.sanity_check_ast()
    elif (ast is not None):
        self.ast = ast
        self.sanity_check_ast()
    self.builtin.update({'meson': MesonMain(build, self)})
    self.generators = []
    self.visited_subdirs = {}
    self.project_args_frozen = False
    self.global_args_frozen = False
    self.subprojects = {}
    self.subproject_stack = []
    self.configure_file_outputs = {}
    if default_project_options:
        self.default_project_options = default_project_options.copy()
    else:
        self.default_project_options = {}
    self.project_default_options = {}
    self.build_func_dict()
    self.build_def_files = [os.path.join(self.subdir, environment.build_filename)]
    if (not mock):
        self.parse_project()
    self._redetect_machines()