cmake: fix BUILD_SHARED_LIBS build on mac
add some missing dependencies and convert utility libraries to
static only libraries to avoid creating unnecessary shared object
libraries which may fail to link due to missing symbols.
@@ -349,20 +349,21 @@ if(WEBP_BUILD_ANIM_UTILS
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "EXAMPLEUTIL_SRCS"
"example_util_[^ ]*")
list(APPEND EXAMPLEUTIL_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/examples/stopwatch.h)
- add_library(exampleutil ${EXAMPLEUTIL_SRCS})
+ add_library(exampleutil STATIC ${EXAMPLEUTIL_SRCS})
+ target_link_libraries(exampleutil imageioutil)
target_include_directories(
exampleutil
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>)
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/imageio "IMAGEIOUTILS_SRCS"
"imageio_util_[^ ]*")
- add_library(imageioutil ${IMAGEIOUTILS_SRCS})
+ add_library(imageioutil STATIC ${IMAGEIOUTILS_SRCS})
target_link_libraries(imageioutil webp)
# Image-decoding utility library.
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/imageio "IMAGEDEC_SRCS"
"imagedec_[^ ]*")
- add_library(imagedec ${IMAGEDEC_SRCS})
+ add_library(imagedec STATIC ${IMAGEDEC_SRCS})
target_link_libraries(imagedec
imageioutil
webpdemux
@@ -372,8 +373,8 @@ if(WEBP_BUILD_ANIM_UTILS
# Image-encoding utility library.
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/imageio "IMAGEENC_SRCS"
"imageenc_[^ ]*")
- add_library(imageenc ${IMAGEENC_SRCS})
- target_link_libraries(imageenc webp)
+ add_library(imageenc STATIC ${IMAGEENC_SRCS})
+ target_link_libraries(imageenc imageioutil webp)
set_property(TARGET exampleutil
imageioutil
