vcpkg/ports/libwebp/0001-build.patch

46 lines
1.9 KiB
Diff
Raw Normal View History

2020-01-15 07:26:58 +08:00
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bd1bebb..4ce801d 100644
2020-01-15 07:26:58 +08:00
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -214,6 +214,9 @@ endfunction()
2020-01-15 07:26:58 +08:00
if(MSVC)
# avoid security warnings for e.g., fopen() used in the examples.
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+ if(BUILD_SHARED_LIBS)
+ add_definitions("-DWEBP_EXTERN=__declspec(dllexport)" "-DWEBP_DLL")
+ endif()
else()
add_definitions(-Wall)
endif()
@@ -482,7 +485,7 @@ if(WEBP_BUILD_LIBWEBPMUX)
2020-01-15 07:26:58 +08:00
"${CMAKE_CURRENT_SOURCE_DIR}/src/webp/mux.h;\
${CMAKE_CURRENT_SOURCE_DIR}/src/webp/mux_types.h;\
${CMAKE_CURRENT_SOURCE_DIR}/src/webp/types.h;")
- set_target_properties(libwebpmux PROPERTIES OUTPUT_NAME webpmux)
2020-01-17 02:39:47 +08:00
+ set_target_properties(libwebpmux PROPERTIES OUTPUT_NAME $<$<PLATFORM_ID:Windows>:lib>webpmux)
2020-01-15 07:26:58 +08:00
list(APPEND INSTALLED_LIBRARIES libwebpmux)
configure_pkg_config("src/mux/libwebpmux.pc")
endif()
@@ -586,8 +589,12 @@ if(WEBP_BUILD_EXTRAS)
2020-01-15 07:26:58 +08:00
# webp_quality
add_executable(webp_quality ${WEBP_QUALITY_SRCS} ${WEBP_EXTRAS_SRCS})
target_link_libraries(webp_quality exampleutil imagedec)
+ if(BUILD_SHARED_LIBS)
+ target_link_libraries(webp_quality webpdspdecode)
+ endif()
2020-01-15 07:26:58 +08:00
target_include_directories(webp_quality
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
2020-01-15 07:26:58 +08:00
${CMAKE_CURRENT_BINARY_DIR})
# vwebp_sdl
@@ -620,7 +627,7 @@ if(WEBP_BUILD_WEBP_JS)
-s EXPORTED_FUNCTIONS='[\"_WebpToSDL\"]' -s INVOKE_RUN=0 \
-s EXPORTED_RUNTIME_METHODS='[\"cwrap\"]'")
set_target_properties(webp_js PROPERTIES OUTPUT_NAME webp)
- target_compile_definitions(webp_js PUBLIC EMSCRIPTEN WEBP_HAVE_SDL)
+ target_compile_definitions(webp_js PUBLIC EMSCRIPTEN WEBP_HAVE_SDL WEBP_HAVE_JUST_SDL_H)
endif()
# WASM version