فهرست منبع

cmake: privately add sources to targets

Public sources get added to dependencies of the target as well which can
cause duplicate symbols.
Ben Boeckel 7 سال پیش
والد
کامیت
9d0a44c9de
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      cmake/protobuf-config.cmake.in

+ 1 - 1
cmake/protobuf-config.cmake.in

@@ -110,7 +110,7 @@ function(protobuf_generate)
     set(${protobuf_generate_OUT_VAR} ${_generated_srcs_all} PARENT_SCOPE)
     set(${protobuf_generate_OUT_VAR} ${_generated_srcs_all} PARENT_SCOPE)
   endif()
   endif()
   if(protobuf_generate_TARGET)
   if(protobuf_generate_TARGET)
-    target_sources(${protobuf_generate_TARGET} PUBLIC ${_generated_srcs_all})
+    target_sources(${protobuf_generate_TARGET} PRIVATE ${_generated_srcs_all})
   endif()
   endif()
 
 
 endfunction()
 endfunction()