Build Instructions jpeg xl - cocoon/jxl.Net GitHub Wiki
new Home: https://github.com/libjxl/libjxl/issues
- 0.3.3:
-
https://gitlab.com/wg1/jpeg-xl/-/issues/165 (apply with:
git apply < patchfilename.diff
) - https://gitlab.com/wg1/jpeg-xl/-/issues/166#note_523689644
- 0.3.2: required fix to build: https://gitlab.com/wg1/jpeg-xl/-/issues/156
- The official instructions can be found here: https://gitlab.com/wg1/jpeg-xl/-/blob/master/README.md
- For Win64: https://gitlab.com/wg1/jpeg-xl/-/blob/master/doc/developing_in_windows.md
- Guide: https://docs.microsoft.com/en-us/cpp/build/install-vcpkg
- Official Page: https://vcpkg.readthedocs.io/
- Clone from GitHub: git clone https://github.com/Microsoft/vcpkg
- Run the bootstrap script in the vcpkg folder:
- bootstrap-vcpkg.bat -disableMetrics
- Ubuntu:~/$ ./bootstrap-vcpkg.sh -disableMetrics
- vcpkg.exe can be found in the root of the repository
git pull
bootstrap-vcpkg.bat -disableMetrics
vcpkg.exe update
vcpkg.exe upgrade --no-dry-run
- For all current required check official page: https://gitlab.com/wg1/jpeg-xl/-/blob/master/doc/developing_in_windows.md
- For static build you need to specify the static packages
vcpkg install libjpeg-turbo:x64-windows-static
vcpkg install zlib:x64-windows-static
vcpkg install libpng:x64-windows-static
vcpkg install giflib:x64-windows-static
The files can then be found here:
vcpkg\installed\x64-windows-static\
git clone --recursive https://gitlab.com/wg1/jpeg-xl
cd jpeg-xl
git checkout 5175d11717f3c48cf506a2c0e0afb070392ae296
#fix build: add #include <atomic> to the lib/jxl/butteraugli/butteraugli.h
mkdir build
cd build
cmake ..
- Then start CMAKE GUI
- Configure "Where is the source code:" point to the cloned git folder
jpeg-xl\
- Configure "Where to build the binaries:" point to
jpeg-xl\build
For a static build change all /Md flags to /MT or /MTd
//Flags used by the CXX compiler during DEBUG builds.
CMAKE_CXX_FLAGS_DEBUG:STRING=/MTd /Zi /Ob0 /Od /RTC1
//Flags used by the CXX compiler during MINSIZEREL builds.
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/MT /O1 /Ob1 /DNDEBUG
//Flags used by the CXX compiler during RELEASE builds.
CMAKE_CXX_FLAGS_RELEASE:STRING=/MT /O2 /Ob2 /DNDEBUG
//Flags used by the CXX compiler during RELWITHDEBINFO builds.
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/MT /Zi /O2 /Ob1 /DNDEBUG
//Flags used by the C compiler during DEBUG builds.
CMAKE_C_FLAGS_DEBUG:STRING=/MTd /Zi /Ob0 /Od /RTC1
//Flags used by the C compiler during MINSIZEREL builds.
CMAKE_C_FLAGS_MINSIZEREL:STRING=/MT /O1 /Ob1 /DNDEBUG
//Flags used by the C compiler during RELEASE builds.
CMAKE_C_FLAGS_RELEASE:STRING=/MT /O2 /Ob2 /DNDEBUG
//Flags used by the C compiler during RELWITHDEBINFO builds.
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MT /Zi /O2 /Ob1 /DNDEBUG
- Configure all Lib paths to where vcpkg installed them, examples:
...
//Path to a file.
GIF_INCLUDE_DIR:PATH=C:\vcpkg\installed\x64-windows-static\include
//Path to a library.
GIF_LIBRARY:FILEPATH=C:\vcpkg\installed\x64-windows-static\lib\gif.lib
...
//Path to a library.
PNG_LIBRARY_DEBUG:FILEPATH=C:\vcpkg\installed\x64-windows-static\debug\lib\libpng16d.lib
//Path to a library.
PNG_LIBRARY_RELEASE:FILEPATH=C:\vcpkg\installed\x64-windows-static\lib\libpng16.lib
//Path to a file.
PNG_PNG_INCLUDE_DIR:PATH=C:\vcpkg\installed\x64-windows-static\include
...
in CMAKE GUI press
- Configure
- Generate
- Open in Visual Studio
In Visual Studio:
- Build
If build fails it might help to switch "Platform Toolset" to "LLVM (clang-cl)"