Skip to content

Commit

Permalink
Switch to libjpeg-turbo for Windows (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmilos authored May 11, 2021
1 parent 0d5f8d6 commit ae82264
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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

0 comments on commit ae82264

Please sign in to comment.