Skip to content

Commit

Permalink
corrected logging during build (#207)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <[email protected]>
  • Loading branch information
bigcat88 authored Feb 4, 2024
1 parent 0ba3974 commit d90fa5b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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 ""

Expand Down

0 comments on commit d90fa5b

Please sign in to comment.