def add_build_def_file(self, f: mesonlib.FileOrString) -> None:
    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())
        try:
            f_ = Path(f).resolve()
        except OSError:
            f_ = Path(f)
            s = f_.stat()
            if (hasattr(s, 'st_file_attributes') and ((s.st_file_attributes & stat.FILE_ATTRIBUTE_REPARSE_POINT) != 0) and (s.st_reparse_tag == stat.IO_REPARSE_TAG_APPEXECLINK)):
                f_ = (f_.parent.resolve() / f_.name)
            else:
                raise
        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.add(f)
def add_build_def_file(self, f: mesonlib.FileOrString) -> None:
    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())
        try:
            f_ = Path(f).resolve()
        except OSError:
            f_ = Path(f)
            s = f_.stat()
            if (hasattr(s, 'st_file_attributes') and ((s.st_file_attributes & stat.FILE_ATTRIBUTE_REPARSE_POINT) != 0) and (s.st_reparse_tag == stat.IO_REPARSE_TAG_APPEXECLINK)):
                f_ = (f_.parent.resolve() / f_.name)
            else:
                raise
        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.add(f)