-
Notifications
You must be signed in to change notification settings - Fork 196
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
cmake: backport support for vendored libavif to SDL2_image #392
Conversation
OK, I cross-built dav1d for x86_64 mac, the same errors, and cmake The problem seems to be with symbol decoration: macho and windows- |
For reference, here are the configs generated by meson: meson_configs.zip |
Manually adding However: There seem to be more missing stuff in dav1d cmake port, Is it not possible to run meson configurator from within cmake?? |
I could find https://discourse.cmake.org/t/3985 and |
The following seems to work for me and seems to match meson better. |
OK, I pushed libsdl-org/dav1d@66d3dd8 to our dav1d 1.2.1-SDL branch and bumped the dav1d revision here accordingly. The CI link failure seems to be cured. @madebr: Please confirm that things are in order. If you confirm, I will bump it in SDL3 branch too. @slouken: Noticed a few things in your dav1d Android configuration:
|
Your dav1d changes look fine, I have these suggestions:
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -151,19 +151,15 @@ else()
set(CONFIG_LOG 0)
endif()
-list(APPEND config01_variables TRIM_DSP_FUNCTIONS)
-if(CMAKE_BUILD_TYPE STREQUAL "Release" OR
- CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
-set(TRIM_DSP_FUNCTIONS 1)
-endif()
+# TRIM_DSP_FUNCTIONS=1 if Release or Debug mode
+add_definitions(-DTRIM_DSP_FUNCTIONS=$<BOOL:$<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>>>)
-if(NOT DAV1D_STACK_ALIGNMENT)
- if(DAV1D_CPU_X64 OR APPLE OR (CMAKE_SYSTEM_NAME MATCHES ".*Linux"))
- set(DAV1D_STACK_ALIGNMENT 16)
- else()
- set(DAV1D_STACK_ALIGNMENT 4)
- endif()
+if(DAV1D_CPU_X64 OR APPLE OR CMAKE_SYSTEM_NAME MATCHES ".*Linux")
+ set(DAV1D_STACK_ALIGNMENT_DEFAULT 16)
+else()
+ set(DAV1D_STACK_ALIGNMENT_DEFAULT 4)
endif()
+set(DAV1D_STACK_ALIGNMENT "${DAV1D_STACK_ALIGNMENT_DEFAULT}" CACHE STRING "Dav1d stack alignment")
list(APPEND config_variables_value STACK_ALIGNMENT)
set(STACK_ALIGNMENT ${DAV1D_STACK_ALIGNMENT})
I tried this approach and asked on the #cmake channel on cpplang.slack.com, but got no satisfying answer (apart from people telling me they got no interest in cmake, or that I should use a package manager). |
OK
OK. It's guaranteed that cmdline arg like
OK, then. |
OK, stopped beign lazy and confirmed that it works, pushed the suggested changes to dav1d, bumped the rev here. Is this PR good? @slouken: Comments for the notes I wrote about your Android and Xcode configs? |
One thing I'm curious about is that how this is happening with MSVC:
|
SDL3 has this too. The MSVC linker emits a warning, not an error, when it receives an unknown argument. |
Well, we should restrict that to non-windows.. (And also to non-openbsd like SDL2/3..) |
Anyways, merging this patch. The rest should be subject to new tickets. |
@madebr: Please review this.
There is a CI run failure with MacOS vendored build like:
... but I think that is a problem with your dav1d cmake support
and not with this backport: I think dav1d is built with either
incorrect nasm output format flags or without any flags at all.
In mac case, we want
-fmacho
, in windows case we want-fwin
,and in linux/elf case we want
-felf
, and all need appending a32
or64
depending on x86 or x64 target.