diff --git a/.github/scripts/build-windows.ps1 b/.github/scripts/build-windows.ps1 index daae2f8..d6e30fb 100644 --- a/.github/scripts/build-windows.ps1 +++ b/.github/scripts/build-windows.ps1 @@ -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 diff --git a/setup.py b/setup.py index f5fc80e..9f129dc 100644 --- a/setup.py +++ b/setup.py @@ -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 @@ -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', ]