Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to libjpeg-turbo for Windows #142

Merged
merged 4 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/build-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ $env:CONDA_ROOT = $pwd.Path + "\external\miniconda_$env:PYTHON_ARCH"

exec { conda update --yes -n base -c defaults conda }

exec { conda create --yes --name pyenv_build python=$env:PYTHON_VERSION numpy=$env:NUMPY_VERSION cython jpeg zlib --force }
exec { conda create --yes --name pyenv_build -c defaults --strict-channel-priority python=$env:PYTHON_VERSION numpy=$env:NUMPY_VERSION cython zlib conda-forge::libjpeg-turbo --force }
exec { conda activate pyenv_build }

# Check that we have the expected version and architecture for Python
Expand Down
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ def windows_libraw_compile():
zlib_flag = '-DZLIB_LIBRARY=' + zlib_static + ' '
else:
zlib_flag = ''
jpeg_static = os.path.join(sys.prefix, 'Library', 'lib', 'jpeg-static.lib')
if os.path.exists(jpeg_static):
jpeg_flag = '-DJPEG_LIBRARY=' + jpeg_static + ' '
else:
jpeg_flag = ''

# Important: always use Release build type, otherwise the library will depend on a
# debug version of OpenMP which is not what we bundle it with, and then it would fail
Expand All @@ -194,6 +199,7 @@ def windows_libraw_compile():
'-DENABLE_DEMOSAIC_PACK_GPL3=ON -DDEMOSAIC_PACK_GPL3_RPATH=../../LibRaw-demosaic-pack-GPL3 '
if buildGPLCode else '') +\
zlib_flag +\
jpeg_flag +\
'-DCMAKE_INSTALL_PREFIX=install',
cmake + ' --build . --target install',
]
Expand Down