-
Notifications
You must be signed in to change notification settings - Fork 197
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
Upgrade to Corrosion v0.4.10 #2220
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
set(AVIF_LOCAL_RAV1E_GIT_TAG v0.7.1) | ||
set(AVIF_LOCAL_CORROSION_GIT_TAG v0.4.4) | ||
set(AVIF_LOCAL_CORROSION_GIT_TAG v0.4.10) | ||
set(AVIF_LOCAL_CARGOC_GIT_TAG v0.9.27) | ||
|
||
set(RAV1E_LIB_FILENAME | ||
|
@@ -97,19 +97,10 @@ else() | |
file(MAKE_DIRECTORY ${RAV1E_INCLUDE_DIR}) | ||
set(RAV1E_FOUND ON) | ||
|
||
set(RAV1E_LIBRARIES ${Rust_CARGO_TARGET_LINK_NATIVE_LIBS}) | ||
if(WIN32) | ||
# If an item starts with "/" (e.g., "/defaultlib:msvcrt"), change the | ||
# leading "/" to "-" so that the target_link_libraries() call below | ||
# will treat the item as a linker flag. | ||
list(TRANSFORM RAV1E_LIBRARIES REPLACE "^/" "-") | ||
# Remove msvcrt from RAV1E_LIBRARIES since it's linked by default | ||
list(REMOVE_ITEM RAV1E_LIBRARIES "msvcrt.lib" "-lmsvcrt") | ||
endif() | ||
|
||
add_library(rav1e::rav1e STATIC IMPORTED) | ||
add_dependencies(rav1e::rav1e rav1e) | ||
target_link_libraries(rav1e::rav1e INTERFACE "${RAV1E_LIBRARIES}") | ||
target_link_libraries(rav1e::rav1e INTERFACE "${Rust_CARGO_TARGET_LINK_NATIVE_LIBS}") | ||
target_link_options(rav1e::rav1e INTERFACE "${Rust_CARGO_TARGET_LINK_OPTIONS}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if we should use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. INTERFACE is the way to go because we are creating a library from scratch. Setting PRIVATE dependencies would not change anything as it is a shell library. INTERFACE ensures anybody depending on rav1e:rav1e will also use the dep. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since
I am also not sure if we need to quote There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That seems fine.
Probably not given it would be a single item or ';' separated list. Though I think quoting is usually safest. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the reply. I did some experiments and found that both of the following are harmless:
So we can just call |
||
set_target_properties(rav1e::rav1e PROPERTIES IMPORTED_LOCATION "${RAV1E_LIB_FILENAME}" AVIF_LOCAL ON FOLDER "ext/rav1e") | ||
target_include_directories(rav1e::rav1e INTERFACE "${RAV1E_INCLUDE_DIR}") | ||
|
||
|
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.
Note that I know Corrosion v0.5.0 is available. The reason I did not upgrade to v0.5.0 in this pull request is that I didn't spend the time understanding the breaking change mentioned in the release notes. We can upgrade to v0.5.0 in a follow-up pull request.