| 197 | """A base class that maps an abstract source to an abstract destination.""" |
| 198 | |
| 199 | def __init__( |
| 200 | self, |
| 201 | src: str, |
| 202 | dst: str, |
| 203 | name: str, |
| 204 | dependent_cmake_flags: List[str], |
| 205 | ): |
| 206 | # Source path; semantics defined by the subclass. |
| 207 | self.src: str = src |
| 208 | |
| 209 | # Destination path relative to a namespace defined elsewhere. If this ends |
| 210 | # in "/", it is treated as a directory. If this is "", it is treated as the |
| 211 | # root of the namespace. |
| 212 | # Destination path; semantics defined by the subclass. |
| 213 | self.dst: str = dst |
| 214 | |
| 215 | # Other parts of setuptools expects .name to exist. For actual extensions |
| 216 | # this can be the module path, but otherwise it should be somehing unique |
| 217 | # that doesn't look like a module path. |
| 218 | self.name: str = name |
| 219 | |
| 220 | self.dependent_cmake_flags = dependent_cmake_flags |
| 221 | self.cmake_cache: Optional[CMakeCache] = None |
| 222 | |
| 223 | super().__init__(name=self.name, sources=[]) |
| 224 | |
| 225 | def _get_build_dir(self, installer: "InstallerBuildExt") -> Path: |
| 226 | # Share the cmake-out location with CustomBuild. |