Commit 9d0a44c9 authored by Ben Boeckel's avatar Ben Boeckel

cmake: privately add sources to targets

Public sources get added to dependencies of the target as well which can
cause duplicate symbols.
parent 47b7d2c7
......@@ -110,7 +110,7 @@ function(protobuf_generate)
set(${protobuf_generate_OUT_VAR} ${_generated_srcs_all} PARENT_SCOPE)
endif()
if(protobuf_generate_TARGET)
target_sources(${protobuf_generate_TARGET} PUBLIC ${_generated_srcs_all})
target_sources(${protobuf_generate_TARGET} PRIVATE ${_generated_srcs_all})
endif()
endfunction()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment