Skip to content

Commit

Permalink
use protobuf_generate in proto cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Nordup committed Jan 26, 2024
1 parent 4c1b920 commit a54ec1d
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/proto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

find_package(Protobuf REQUIRED)

protobuf_generate_cpp(TCP_CPP TCP_HPP "MumbleTCP.proto")
protobuf_generate_cpp(UDP_CPP UDP_HPP "MumbleUDP.proto")

add_library(Proto OBJECT)

target_disable_warnings(Proto)
Expand All @@ -19,17 +16,12 @@ target_include_directories(Proto

set_target_properties(Proto PROPERTIES UNITY_BUILD OFF)

target_sources(Proto
PRIVATE
${TCP_CPP}
${UDP_CPP}
# Marking the headers as PUBLIC causes CMake's configure step to fail.
# The files are generated during the build step.
${TCP_HPP}
${UDP_HPP}
)

target_link_libraries(Proto
PRIVATE
protobuf::libprotobuf
)

protobuf_generate(
TARGET Proto
PROTOS "MumbleTCP.proto" "MumbleUDP.proto"
)

0 comments on commit a54ec1d

Please sign in to comment.