From 9d0a44c9de81222929e527ba245cf52a097ca146 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 19 Jan 2018 12:05:00 -0500 Subject: cmake: privately add sources to targets Public sources get added to dependencies of the target as well which can cause duplicate symbols. --- cmake/protobuf-config.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/protobuf-config.cmake.in b/cmake/protobuf-config.cmake.in index fd67edc3..acedcc7a 100644 --- a/cmake/protobuf-config.cmake.in +++ b/cmake/protobuf-config.cmake.in @@ -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() -- cgit v1.2.3