hook-clr_loader.py 954 B

12345678910111213141516171819202122
  1. # ------------------------------------------------------------------
  2. # Copyright (c) 2022 PyInstaller Development Team.
  3. #
  4. # This file is distributed under the terms of the GNU General Public
  5. # License (version 2.0 or later).
  6. #
  7. # The full license is available in LICENSE, distributed with
  8. # this software.
  9. #
  10. # SPDX-License-Identifier: GPL-2.0-or-later
  11. # ------------------------------------------------------------------
  12. from PyInstaller.compat import is_win, is_cygwin
  13. from PyInstaller.utils.hooks import collect_dynamic_libs
  14. # The clr-loader is used by pythonnet 3.x to load CLR (.NET) runtime.
  15. # On Windows, the default runtime is the .NET Framework, and its corresponding
  16. # loader requires DLLs from clr_loader\ffi\dlls to be collected. This runtime
  17. # is supported only on Windows, so we do not have to worry about it on other
  18. # OSes (where Mono or .NET Core are supported).
  19. if is_win or is_cygwin:
  20. binaries = collect_dynamic_libs("clr_loader")