def add_build_def_file(self, f):
    if isinstance(f, mesonlib.File):
        if f.is_built:
            return
        f = os.path.normpath(f.relative_name())
    elif (os.path.isfile(f) and (not f.startswith('/dev'))):
        srcdir = Path(self.environment.get_source_dir())
        builddir = Path(self.environment.get_build_dir())
        f = Path(f).resolve()
        if (builddir in f.parents):
            return
        if (srcdir in f.parents):
            f = f.relative_to(srcdir)
        f = str(f)
    else:
        return
    if (f not in self.build_def_files):
        self.build_def_files.append(f)
def add_build_def_file(self, f):
    if isinstance(f, mesonlib.File):
        if f.is_built:
            return
        f = os.path.normpath(f.relative_name())
    elif (os.path.isfile(f) and (not f.startswith('/dev'))):
        srcdir = Path(self.environment.get_source_dir())
        builddir = Path(self.environment.get_build_dir())
        f = Path(f).resolve()
        if (builddir in f.parents):
            return
        if (srcdir in f.parents):
            f = f.relative_to(srcdir)
        f = str(f)
    else:
        return
    if (f not in self.build_def_files):
        self.build_def_files.append(f)