AOMediaCodec / libavif

libavif - Library for encoding and decoding .avif files
Other
1.53k stars 195 forks source link

Windows: change leading / to - in RAV1E_LIBRARIES #2219

Closed wantehchang closed 3 months ago

wantehchang commented 3 months ago

Fix the ci-windows.yml error in the "Build libavif (ninja)" step: ninja: error: '/defaultlib:msvcrt', needed by 'avif_example_decode_memory.exe', missing and no known rule to make it

RAV1E_LIBRARIES is passed to target_link_libraries(). Item names starting with -, but not -l or -framework, are treated by target_link_libraries() as linker flags. On Windows, linker flags may start with / (e.g., /defaultlib:msvcrt), so we need to change / to - before passing the linker flags to target_link_libraries(). Otherwise target_link_libraries() will incorrectly treat those linker flags as libraries.