-
Notifications
You must be signed in to change notification settings - Fork 208
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
Use libjpeg-turbo in ext/libjpeg.cmd #1994
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_DIR "${AVIF_SOURCE_DIR}/ext/libjpeg-turbo/build.libavif") | ||
if(WIN32) | ||
set(LIB_FILENAME "${LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}jpeg-static${CMAKE_STATIC_LIBRARY_SUFFIX}") | ||
wantehchang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
else() | ||
set(LIB_FILENAME "${LIB_DIR}/${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_DIR}") |
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 tag below is 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we delete the
/ext/libjpeg
line?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought I could leave it for now. If users update their local repositories instead of cloning fresh ones, it will avoid an eventual
libjpeg
entry popping intogit status
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing the
ext/libjpeg
entry in thegit status
output could remind the user to delete the directory. That seems good.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
The case I had in mind was switching between the
main
andv1.0.x
branches while keeping bothext/libjpeg
andext/libjpeg-turbo
.Not sure what this refers to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant it seems good to have the
ext/libjpeg
entry in thegit status
output, because it could remind the user to delete the directory.