From 7c1f25528efdf5aa695d7eac8632656194991245 Mon Sep 17 00:00:00 2001 From: Alexander Piskun Date: Sun, 4 Feb 2024 14:28:30 +0300 Subject: [PATCH] corrected logging during build Signed-off-by: Alexander Piskun --- setup.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 2089fcbf..b3bf0cee 100644 --- a/setup.py +++ b/setup.py @@ -156,8 +156,10 @@ def build_extensions(self): # noqa # self._add_directory(include_dirs, path.join(include_path_prefix, "include")) self._add_directory(library_dirs, library_dir) lib_export_file = Path(os.path.join(library_dir, "libheif.dll.a")) - if lib_export_file.is_file(): - copy(lib_export_file, os.path.join(library_dir, "libheif.lib")) + lib_lib_file = Path(os.path.join(library_dir, "libheif.lib")) + if lib_export_file.is_file() and not lib_lib_file.is_file(): + print(f"Copying {lib_export_file} to {lib_lib_file}") + copy(lib_export_file, lib_lib_file) else: warn("If you build this with MSYS2, you should not see this warning.", stacklevel=1) @@ -226,16 +228,16 @@ def _update_extension(self, name, libraries, extra_compile_args=None, extra_link def _find_include_dir(self, dirname, include): for directory in self.compiler.include_dirs: - print("Checking for include file %s in %s", (include, directory)) + print(f"Checking for include file '{include}' in '{directory}'") result_path = os.path.join(directory, include) if os.path.isfile(result_path): - print("Found %s in %s", (include, directory)) + print(f"Found '{include}' in '{directory}'") return result_path subdir = os.path.join(directory, dirname) - print("Checking for include file %s in %s", (include, subdir)) + print(f"Checking for include file '{include}' in '{subdir}'") result_path = os.path.join(subdir, include) if os.path.isfile(result_path): - print("Found %s in %s", (include, subdir)) + print(f"Found '{include}' in '{subdir}'") return result_path return ""