提交 d7bd0361 编写于 作者: W Wu Yi 提交者: Tao Luo

fix dist deps (#14471)

* fix dist deps test=develop

* update test=develop

* update test=develop

* update test=develop

* update test=develop
上级 05c15a08
...@@ -196,7 +196,7 @@ endfunction() ...@@ -196,7 +196,7 @@ endfunction()
function(register_operators) function(register_operators)
set(options "") set(options "")
set(oneValueArgs "") set(oneValueArgs "")
set(multiValueArgs EXCLUDES) set(multiValueArgs EXCLUDES DEPS)
cmake_parse_arguments(register_operators "${options}" "${oneValueArgs}" cmake_parse_arguments(register_operators "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN}) "${multiValueArgs}" ${ARGN})
...@@ -204,11 +204,16 @@ function(register_operators) ...@@ -204,11 +204,16 @@ function(register_operators)
string(REPLACE "_mkldnn" "" OPS "${OPS}") string(REPLACE "_mkldnn" "" OPS "${OPS}")
string(REPLACE ".cc" "" OPS "${OPS}") string(REPLACE ".cc" "" OPS "${OPS}")
list(REMOVE_DUPLICATES OPS) list(REMOVE_DUPLICATES OPS)
list(LENGTH register_operators_DEPS register_operators_DEPS_len)
foreach(src ${OPS}) foreach(src ${OPS})
list(FIND register_operators_EXCLUDES ${src} _index) list(FIND register_operators_EXCLUDES ${src} _index)
if (${_index} EQUAL -1) if (${_index} EQUAL -1)
op_library(${src}) if (${register_operators_DEPS_len} GREATER 0)
op_library(${src} DEPS ${register_operators_DEPS})
else()
op_library(${src})
endif()
endif() endif()
endforeach() endforeach()
endfunction() endfunction()
...@@ -29,11 +29,11 @@ foreach(src ${OPS}) ...@@ -29,11 +29,11 @@ foreach(src ${OPS})
set_source_files_properties(${src} PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS}) set_source_files_properties(${src} PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
endforeach() endforeach()
register_operators(EXCLUDES gen_nccl_id_op) register_operators(EXCLUDES gen_nccl_id_op DEPS ${DISTRIBUTE_DEPS})
if(WITH_GPU AND NOT WIN32) if(WITH_GPU AND NOT WIN32)
set(DISTRIBUTE_DEPS ${DISTRIBUTE_DEPS} nccl_common) set(DISTRIBUTE_DEPS ${DISTRIBUTE_DEPS} nccl_common)
op_library(gen_nccl_id_op) op_library(gen_nccl_id_op ${DISTRIBUTE_DEPS} nccl_common)
endif() endif()
set(OPERATOR_DEPS ${OPERATOR_DEPS} ${DISTRIBUTE_DEPS} PARENT_SCOPE) set(OPERATOR_DEPS ${OPERATOR_DEPS} ${DISTRIBUTE_DEPS} PARENT_SCOPE)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册