| 145 | self.fc_flags = _get_flags(self.fc_flags) |
| 146 | |
| 147 | def _move_exec_to_root(self, build_dir: Path): |
| 148 | walk_dir = Path(build_dir) / self.meson_build_dir |
| 149 | path_objects = chain( |
| 150 | walk_dir.glob(f"{self.modulename}*.so"), |
| 151 | walk_dir.glob(f"{self.modulename}*.pyd"), |
| 152 | walk_dir.glob(f"{self.modulename}*.dll"), |
| 153 | ) |
| 154 | # Same behavior as distutils |
| 155 | # https://github.com/numpy/numpy/issues/24874#issuecomment-1835632293 |
| 156 | for path_object in path_objects: |
| 157 | dest_path = Path.cwd() / path_object.name |
| 158 | if dest_path.exists(): |
| 159 | dest_path.unlink() |
| 160 | shutil.copy2(path_object, dest_path) |
| 161 | os.remove(path_object) |
| 162 | |
| 163 | def write_meson_build(self, build_dir: Path) -> None: |
| 164 | """Writes the meson build file at specified location""" |