@@ -427,12 +427,6 @@ def _install_path(self, wheel_file: mesonpy._wheelfile.WheelFile, origin: Path,
427
427
428
428
if self ._has_internal_libs :
429
429
if _is_native (origin ):
430
- if sys .platform == 'win32' and not self ._allow_windows_shared_libs :
431
- raise NotImplementedError (
432
- 'Loading shared libraries bundled in the Python wheel on Windows requires '
433
- 'setting the DLL load path or preloading. See the documentation for '
434
- 'the "tool.meson-python.allow-windows-internal-shared-libs" option.' )
435
-
436
430
# When an executable, libray, or Python extension module is
437
431
# dynamically linked to a library built as part of the project,
438
432
# Meson adds a library load path to it pointing to the build
@@ -469,6 +463,12 @@ def _wheel_write_metadata(self, whl: mesonpy._wheelfile.WheelFile) -> None:
469
463
whl .write (f , f'{ self ._distinfo_dir } /licenses/{ pathlib .Path (f ).as_posix ()} ' )
470
464
471
465
def build (self , directory : Path ) -> pathlib .Path :
466
+ if sys .platform == 'win32' and self ._has_internal_libs and not self ._allow_windows_shared_libs :
467
+ raise NotImplementedError (
468
+ 'Loading shared libraries bundled in the Python wheel on Windows requires '
469
+ 'setting the DLL load path or preloading. See the documentation for '
470
+ 'the "tool.meson-python.allow-windows-internal-shared-libs" option.' )
471
+
472
472
wheel_file = pathlib .Path (directory , f'{ self .name } .whl' )
473
473
with mesonpy ._wheelfile .WheelFile (wheel_file , 'w' ) as whl :
474
474
self ._wheel_write_metadata (whl )
0 commit comments