libprotobuf-lite.cmake 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. set(libprotobuf_lite_files
  2. ${protobuf_source_dir}/src/google/protobuf/any_lite.cc
  3. ${protobuf_source_dir}/src/google/protobuf/arena.cc
  4. ${protobuf_source_dir}/src/google/protobuf/arenastring.cc
  5. ${protobuf_source_dir}/src/google/protobuf/extension_set.cc
  6. ${protobuf_source_dir}/src/google/protobuf/generated_enum_util.cc
  7. ${protobuf_source_dir}/src/google/protobuf/generated_message_table_driven_lite.cc
  8. ${protobuf_source_dir}/src/google/protobuf/generated_message_util.cc
  9. ${protobuf_source_dir}/src/google/protobuf/implicit_weak_message.cc
  10. ${protobuf_source_dir}/src/google/protobuf/io/coded_stream.cc
  11. ${protobuf_source_dir}/src/google/protobuf/io/io_win32.cc
  12. ${protobuf_source_dir}/src/google/protobuf/io/strtod.cc
  13. ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream.cc
  14. ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl.cc
  15. ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl_lite.cc
  16. ${protobuf_source_dir}/src/google/protobuf/map.cc
  17. ${protobuf_source_dir}/src/google/protobuf/message_lite.cc
  18. ${protobuf_source_dir}/src/google/protobuf/parse_context.cc
  19. ${protobuf_source_dir}/src/google/protobuf/repeated_field.cc
  20. ${protobuf_source_dir}/src/google/protobuf/stubs/bytestream.cc
  21. ${protobuf_source_dir}/src/google/protobuf/stubs/common.cc
  22. ${protobuf_source_dir}/src/google/protobuf/stubs/int128.cc
  23. ${protobuf_source_dir}/src/google/protobuf/stubs/status.cc
  24. ${protobuf_source_dir}/src/google/protobuf/stubs/statusor.cc
  25. ${protobuf_source_dir}/src/google/protobuf/stubs/stringpiece.cc
  26. ${protobuf_source_dir}/src/google/protobuf/stubs/stringprintf.cc
  27. ${protobuf_source_dir}/src/google/protobuf/stubs/structurally_valid.cc
  28. ${protobuf_source_dir}/src/google/protobuf/stubs/strutil.cc
  29. ${protobuf_source_dir}/src/google/protobuf/stubs/time.cc
  30. ${protobuf_source_dir}/src/google/protobuf/wire_format_lite.cc
  31. )
  32. set(libprotobuf_lite_includes
  33. ${protobuf_source_dir}/src/google/protobuf/arena.h
  34. ${protobuf_source_dir}/src/google/protobuf/arenastring.h
  35. ${protobuf_source_dir}/src/google/protobuf/extension_set.h
  36. ${protobuf_source_dir}/src/google/protobuf/generated_message_util.h
  37. ${protobuf_source_dir}/src/google/protobuf/implicit_weak_message.h
  38. ${protobuf_source_dir}/src/google/protobuf/parse_context.h
  39. ${protobuf_source_dir}/src/google/protobuf/io/coded_stream.h
  40. ${protobuf_source_dir}/src/google/protobuf/io/strtod.h
  41. ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream.h
  42. ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl.h
  43. ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl_lite.h
  44. ${protobuf_source_dir}/src/google/protobuf/message_lite.h
  45. ${protobuf_source_dir}/src/google/protobuf/repeated_field.h
  46. ${protobuf_source_dir}/src/google/protobuf/stubs/bytestream.h
  47. ${protobuf_source_dir}/src/google/protobuf/stubs/common.h
  48. ${protobuf_source_dir}/src/google/protobuf/stubs/int128.h
  49. ${protobuf_source_dir}/src/google/protobuf/stubs/once.h
  50. ${protobuf_source_dir}/src/google/protobuf/stubs/status.h
  51. ${protobuf_source_dir}/src/google/protobuf/stubs/statusor.h
  52. ${protobuf_source_dir}/src/google/protobuf/stubs/stringpiece.h
  53. ${protobuf_source_dir}/src/google/protobuf/stubs/stringprintf.h
  54. ${protobuf_source_dir}/src/google/protobuf/stubs/strutil.h
  55. ${protobuf_source_dir}/src/google/protobuf/stubs/time.h
  56. ${protobuf_source_dir}/src/google/protobuf/wire_format_lite.h
  57. )
  58. if (MSVC)
  59. set(libprotobuf_lite_rc_files
  60. ${CMAKE_CURRENT_BINARY_DIR}/version.rc
  61. )
  62. endif()
  63. add_library(libprotobuf-lite ${protobuf_SHARED_OR_STATIC}
  64. ${libprotobuf_lite_files} ${libprotobuf_lite_includes} ${libprotobuf_lite_rc_files})
  65. target_link_libraries(libprotobuf-lite ${CMAKE_THREAD_LIBS_INIT})
  66. if(protobuf_LINK_LIBATOMIC)
  67. target_link_libraries(libprotobuf-lite atomic)
  68. endif()
  69. target_include_directories(libprotobuf-lite PUBLIC ${protobuf_source_dir}/src)
  70. if(MSVC AND protobuf_BUILD_SHARED_LIBS)
  71. target_compile_definitions(libprotobuf-lite
  72. PUBLIC PROTOBUF_USE_DLLS
  73. PRIVATE LIBPROTOBUF_EXPORTS)
  74. endif()
  75. set_target_properties(libprotobuf-lite PROPERTIES
  76. VERSION ${protobuf_VERSION}
  77. OUTPUT_NAME ${LIB_PREFIX}protobuf-lite
  78. DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
  79. add_library(protobuf::libprotobuf-lite ALIAS libprotobuf-lite)