Index: third_party/protobuf/cmake/libprotobuf.cmake |
diff --git a/third_party/protobuf/cmake/libprotobuf.cmake b/third_party/protobuf/cmake/libprotobuf.cmake |
index 8930c1ca1ecfeb0811ea41e8f294131df1d1ebaa..26e1f356176af93357c6576e3d5d8c9ce08ee8da 100644 |
--- a/third_party/protobuf/cmake/libprotobuf.cmake |
+++ b/third_party/protobuf/cmake/libprotobuf.cmake |
@@ -56,7 +56,10 @@ set(libprotobuf_files |
add_library(libprotobuf ${protobuf_SHARED_OR_STATIC} |
${libprotobuf_lite_files} ${libprotobuf_files}) |
-target_link_libraries(libprotobuf ${CMAKE_THREAD_LIBS_INIT} ${ZLIB_LIBRARIES}) |
+target_link_libraries(libprotobuf ${CMAKE_THREAD_LIBS_INIT}) |
+if(protobuf_WITH_ZLIB) |
+ target_link_libraries(libprotobuf ${ZLIB_LIBRARIES}) |
+endif() |
target_include_directories(libprotobuf PUBLIC ${protobuf_source_dir}/src) |
if(MSVC AND protobuf_BUILD_SHARED_LIBS) |
target_compile_definitions(libprotobuf |