aboutsummaryrefslogtreecommitdiff
path: root/cmake/libprotobuf.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/libprotobuf.cmake')
-rw-r--r--cmake/libprotobuf.cmake13
1 files changed, 10 insertions, 3 deletions
diff --git a/cmake/libprotobuf.cmake b/cmake/libprotobuf.cmake
index 64a9cae0..8930c1ca 100644
--- a/cmake/libprotobuf.cmake
+++ b/cmake/libprotobuf.cmake
@@ -40,6 +40,7 @@ set(libprotobuf_files
${protobuf_source_dir}/src/google/protobuf/util/internal/json_objectwriter.cc
${protobuf_source_dir}/src/google/protobuf/util/internal/json_stream_parser.cc
${protobuf_source_dir}/src/google/protobuf/util/internal/object_writer.cc
+ ${protobuf_source_dir}/src/google/protobuf/util/internal/proto_writer.cc
${protobuf_source_dir}/src/google/protobuf/util/internal/protostream_objectsource.cc
${protobuf_source_dir}/src/google/protobuf/util/internal/protostream_objectwriter.cc
${protobuf_source_dir}/src/google/protobuf/util/internal/type_info.cc
@@ -53,9 +54,15 @@ set(libprotobuf_files
${protobuf_source_dir}/src/google/protobuf/wrappers.pb.cc
)
-add_library(libprotobuf ${libprotobuf_lite_files} ${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_include_directories(libprotobuf PUBLIC ${protobuf_source_dir}/src)
+if(MSVC AND protobuf_BUILD_SHARED_LIBS)
+ target_compile_definitions(libprotobuf
+ PUBLIC PROTOBUF_USE_DLLS
+ PRIVATE LIBPROTOBUF_EXPORTS)
+endif()
set_target_properties(libprotobuf PROPERTIES
- COMPILE_DEFINITIONS LIBPROTOBUF_EXPORTS
- OUTPUT_NAME ${LIB_PREFIX}protobuf)
+ OUTPUT_NAME ${LIB_PREFIX}protobuf
+ DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")