Skip to content

Commit

Permalink
CMake: Link to ZLIB only if protobuf_WITH_ZLIB enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
podsvirov committed Jul 27, 2016
1 parent e7982e4 commit 38c5f2f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmake/libprotobuf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 38c5f2f

Please sign in to comment.