mirror of
https://github.com/lux-tel/libsession-util.git
synced 2026-10-30 20:25:11 +00:00
39 lines
1.0 KiB
CMake
39 lines
1.0 KiB
CMake
|
|
libsession_static_bundle(protobuf::libprotobuf-lite)
|
|
|
|
|
|
add_library(protos
|
|
SessionProtos.pb.cc
|
|
WebSocketResources.pb.cc)
|
|
target_include_directories(protos PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
target_link_libraries(protos PUBLIC protobuf::libprotobuf-lite)
|
|
set_target_properties(
|
|
protos PROPERTIES
|
|
OUTPUT_NAME session-protos
|
|
SOVERSION ${LIBSESSION_LIBVERSION})
|
|
|
|
# -Wunused-parameter triggers in the protobuf dependency
|
|
message(STATUS "Disabling -Werror for proto unused-parameter")
|
|
|
|
if (MSVC)
|
|
else()
|
|
target_compile_options(protos PUBLIC -Wno-error=unused-parameter)
|
|
endif()
|
|
|
|
libsession_static_bundle(protos)
|
|
|
|
add_library(libsession::protos ALIAS protos)
|
|
export(
|
|
TARGETS protos
|
|
NAMESPACE libsession::
|
|
FILE libsessionTargets.cmake
|
|
)
|
|
list(APPEND libsession_export_targets protos)
|
|
set(libsession_export_targets "${libsession_export_targets}" PARENT_SCOPE)
|
|
|
|
|
|
add_custom_target(regen-protobuf
|
|
protoc --cpp_out=. SessionProtos.proto WebSocketResources.proto
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
)
|