From 9f750f7a06a9c75200a01a7e48dd2c4536b2084e Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 22 Oct 2019 12:01:03 -0700 Subject: [PATCH] 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. Change-Id: Iaa91a3d97fa5af6ada4b2a851cc7fc2879d871da --- CMakeLists.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f312269..9a8778f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 $) 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