From 3de3894b821c06daf596c0818b6c89f4dd185928 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Tue, 4 Jul 2017 12:53:00 +0800 Subject: [PATCH] Add DEPS to `proto_library` Missing DEPS will cause compile error when parallel is large. --- cmake/generic.cmake | 4 ++-- paddle/framework/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/generic.cmake b/cmake/generic.cmake index ca358da8f14..fb2222440ca 100644 --- a/cmake/generic.cmake +++ b/cmake/generic.cmake @@ -323,10 +323,10 @@ endfunction(go_test) function(proto_library TARGET_NAME) set(oneValueArgs "") - set(multiValueArgs SRCS) + set(multiValueArgs SRCS DEPS) cmake_parse_arguments(proto_library "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) set(proto_srcs) set(proto_hdrs) protobuf_generate_cpp(proto_srcs proto_hdrs ${proto_library_SRCS}) - cc_library(${TARGET_NAME} SRCS ${proto_srcs} DEPS protobuf) + cc_library(${TARGET_NAME} SRCS ${proto_srcs} DEPS ${proto_library_DEPS} protobuf) endfunction() diff --git a/paddle/framework/CMakeLists.txt b/paddle/framework/CMakeLists.txt index f7e5753ac2c..e7818667592 100644 --- a/paddle/framework/CMakeLists.txt +++ b/paddle/framework/CMakeLists.txt @@ -6,5 +6,5 @@ cc_test(variable_test SRCS variable_test.cc) cc_test(scope_test SRCS scope_test.cc) cc_test(enforce_test SRCS enforce_test.cc) proto_library(attr_type SRCS attr_type.proto) -proto_library(op_proto SRCS op_proto.proto) +proto_library(op_proto SRCS op_proto.proto DEPS attr_type) cc_test(op_proto_test SRCS op_proto_test.cc DEPS op_proto attr_type protobuf) -- GitLab