Skip to content

Commit

Permalink
CMake: Replace deprecated protobuf_generate_cpp()
Browse files Browse the repository at this point in the history
  • Loading branch information
Nordup authored and davidebeatrici committed Mar 3, 2024
1 parent 00c1f15 commit 0031b81
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 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,14 @@ 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 0031b81

Please sign in to comment.