Skip to content

Commit

Permalink
replaced deprecated -OFast compiler flag with -O3 (#305)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
  • Loading branch information
bigcat88 authored Nov 2, 2024
1 parent 469729f commit 03c7beb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def build_extensions(self) -> None: # noqa
self.compiler.include_dirs.append(os.path.dirname(os.path.abspath(__file__)))

if PLATFORM_MINGW:
self._update_extension("_pillow_heif", ["heif"], extra_compile_args=["-Ofast", "-Werror"])
self._update_extension("_pillow_heif", ["heif"], extra_compile_args=["-O3", "-Werror"])
else:
self._update_extension(
"_pillow_heif", ["libheif"], extra_compile_args=["/d2FH4-", "/WX"], extra_link_args=["/WX"]
Expand All @@ -196,7 +196,7 @@ def build_extensions(self) -> None: # noqa
self._add_directory(library_dirs, os.path.join(sdk_path, "usr", "lib"))
self._add_directory(include_dirs, os.path.join(sdk_path, "usr", "include"))

self._update_extension("_pillow_heif", ["heif"], extra_compile_args=["-Ofast", "-Werror"])
self._update_extension("_pillow_heif", ["heif"], extra_compile_args=["-O3", "-Werror"])
else: # let's assume it's some kind of linux
# this old code waiting for refactoring, when time comes.
self._add_directory(include_dirs, "/usr/local/include")
Expand All @@ -206,7 +206,7 @@ def build_extensions(self) -> None: # noqa
self._add_directory(library_dirs, "/usr/lib")
self._add_directory(library_dirs, "/lib")

self._update_extension("_pillow_heif", ["heif"], extra_compile_args=["-Ofast", "-Werror"])
self._update_extension("_pillow_heif", ["heif"], extra_compile_args=["-O3", "-Werror"])

self.compiler.library_dirs = library_dirs + self.compiler.library_dirs
self.compiler.include_dirs = include_dirs + self.compiler.include_dirs
Expand Down

0 comments on commit 03c7beb

Please sign in to comment.