-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use libjpeg-turbo in ext/libjpeg.cmd
- Loading branch information
Showing
7 changed files
with
30 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
/ext/gpac | ||
/ext/libargparse | ||
/ext/libjpeg | ||
/ext/libjpeg-turbo | ||
/ext/libgav1 | ||
/ext/libpng | ||
/ext/libwebp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
add_subdirectory(${AVIF_SOURCE_DIR}/ext/libjpeg EXCLUDE_FROM_ALL) | ||
set(LIB_FOLDER "${AVIF_SOURCE_DIR}/ext/libjpeg-turbo/build.libavif") | ||
if(WIN32) | ||
set(LIB_FILENAME "${LIB_FOLDER}/${CMAKE_STATIC_LIBRARY_PREFIX}jpeg-static${CMAKE_STATIC_LIBRARY_SUFFIX}") | ||
else() | ||
set(LIB_FILENAME "${LIB_FOLDER}/${CMAKE_STATIC_LIBRARY_PREFIX}jpeg${CMAKE_STATIC_LIBRARY_SUFFIX}") | ||
endif() | ||
if(NOT EXISTS "${LIB_FILENAME}") | ||
message(FATAL_ERROR "libavif: ${LIB_FILENAME} is missing, bailing out") | ||
endif() | ||
|
||
set_property(TARGET jpeg PROPERTY AVIF_LOCAL ON) | ||
set(JPEG_INCLUDE_DIR "${AVIF_SOURCE_DIR}/ext/libjpeg") | ||
target_include_directories(jpeg INTERFACE ${JPEG_INCLUDE_DIR}) | ||
add_library(JPEG::JPEG STATIC IMPORTED GLOBAL) | ||
set_target_properties(JPEG::JPEG PROPERTIES IMPORTED_LOCATION "${LIB_FILENAME}" AVIF_LOCAL ON) | ||
set(JPEG_INCLUDE_DIR "${AVIF_SOURCE_DIR}/ext/libjpeg-turbo") | ||
target_include_directories(JPEG::JPEG INTERFACE "${JPEG_INCLUDE_DIR}") | ||
|
||
add_library(JPEG::JPEG ALIAS jpeg) | ||
# Also add the build directory path because it contains jconfig.h, | ||
# which is included by jpeglib.h. | ||
target_include_directories(JPEG::JPEG INTERFACE "${LIB_FOLDER}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
: # If you want to use a local build of jpeg, you must clone the repos in this directory first, | ||
: # then enable CMake's AVIF_LOCAL_JPEG. | ||
: # This git tag isn't likely to move much, as libjpeg isn't actively developed anymore. | ||
: # then set CMake's AVIF_JPEG=LOCAL. | ||
: # The git tags below are known to work, and will occasionally be updated. Feel free to use a more recent commit. | ||
|
||
: # The odd choice of comment style in this file is to try to share this script between *nix and win32. | ||
|
||
git clone --depth 1 https://github.com/joedrago/libjpeg.git | ||
git clone -b 3.0.2 --depth 1 https://github.com/libjpeg-turbo/libjpeg-turbo.git | ||
|
||
cmake -S libjpeg-turbo -B libjpeg-turbo/build.libavif -G Ninja -DENABLE_SHARED=OFF -DENABLE_STATIC=ON -DCMAKE_BUILD_TYPE=Release -DWITH_TURBOJPEG=OFF | ||
cmake --build libjpeg-turbo/build.libavif --parallel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters