Skip to content

Commit 712adc7

Browse files
committed
polish dist cmake
1 parent 1ef6cdb commit 712adc7

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

paddle/fluid/operators/CMakeLists.txt

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ endif()
186186

187187
if(WITH_DISTRIBUTE)
188188
add_subdirectory(distributed)
189-
189+
190190
set(DISTRIBUTE_DEPS "")
191191
if(WITH_GRPC)
192192
set(DISTRIBUTE_DEPS sendrecvop_grpc grpc++_unsecure grpc_unsecure gpr cares zlib protobuf)
@@ -195,18 +195,11 @@ if(WITH_DISTRIBUTE)
195195
endif()
196196

197197
set(DISTRIBUTE_COMPILE_FLAGS "-Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor")
198-
op_library(prefetch_op DEPS ${DISTRIBUTE_DEPS})
199-
set_source_files_properties(prefetch_op.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
200-
op_library(recv_op DEPS ${DISTRIBUTE_DEPS})
201-
set_source_files_properties(recv_op.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
202-
op_library(listen_and_serv_op DEPS ${DISTRIBUTE_DEPS})
203-
set_source_files_properties(listen_and_serv_op.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
204-
op_library(send_op DEPS ${DISTRIBUTE_DEPS})
205-
set_source_files_properties(send_op.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
206-
op_library(send_barrier_op DEPS ${DISTRIBUTE_DEPS})
207-
op_library(fetch_barrier_op DEPS ${DISTRIBUTE_DEPS})
208-
set_source_files_properties(send_barrier_op.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
209-
set_source_files_properties(fetch_barrier_op.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
198+
foreach(dist_op "prefetch_op" "listen_and_serv_op" "send_op" "recv_op" "send_barrier_op" "fetch_barrier_op")
199+
op_library(${dist_op} DEPS ${DISTRIBUTE_DEPS})
200+
set_source_files_properties(${dist_op}.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
201+
endforeach()
202+
210203
#set_source_files_properties(send_recv_op_test.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
211204
#cc_test(test_send_recv SRCS send_recv_op_test.cc DEPS prefetch_op send_op
212205
# listen_and_serv_op sum_op executor SERIAL)

0 commit comments

Comments
 (0)