未验证 提交 e0a9115e 编写于 作者: Z Zhou Wei 提交者: GitHub

fix random compile failure due to missing file (#25661)

上级 b3f58d30
...@@ -819,20 +819,18 @@ function(brpc_library TARGET_NAME) ...@@ -819,20 +819,18 @@ function(brpc_library TARGET_NAME)
cc_library("${TARGET_NAME}" SRCS "${brpc_library_SRCS}" DEPS "${TARGET_NAME}_proto" "${brpc_library_DEPS}") cc_library("${TARGET_NAME}" SRCS "${brpc_library_SRCS}" DEPS "${TARGET_NAME}_proto" "${brpc_library_DEPS}")
endfunction() endfunction()
# copy_if_different from src_file to dst_file before barrier_target. # copy_if_different from src_file to dst_file At the beginning of the build.
function(copy_if_different src_file dst_file barrier_target) function(copy_if_different src_file dst_file)
# this is a dummy target, should always be run to update ${dst_file} get_filename_component(FILE_NAME ${dst_file} NAME_WE)
add_custom_target(before_${barrier_target} ALL
DEPENDS before_${barrier_target}_custom_command
)
add_dependencies(${barrier_target} before_${barrier_target})
add_custom_command( # this is a dummy target for custom command, should always be run firstly to update ${dst_file}
OUTPUT before_${barrier_target}_custom_command add_custom_target(copy_${FILE_NAME}_command ALL
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src_file} ${dst_file} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src_file} ${dst_file}
COMMENT "copy_if_different ${dst_file}" COMMENT "copy_if_different ${dst_file}"
VERBATIM VERBATIM
) )
add_dependencies(extern_glog copy_${FILE_NAME}_command)
endfunction() endfunction()
# create a dummy source file, then create a static library. # create a dummy source file, then create a static library.
......
...@@ -4,7 +4,7 @@ file(WRITE ${pass_file} "// Generated by the paddle/fluid/framework/ir/CMakeList ...@@ -4,7 +4,7 @@ file(WRITE ${pass_file} "// Generated by the paddle/fluid/framework/ir/CMakeList
file(APPEND ${pass_file} "\#pragma once\n") file(APPEND ${pass_file} "\#pragma once\n")
file(APPEND ${pass_file} "\#include \"paddle/fluid/framework/ir/pass.h\"\n") file(APPEND ${pass_file} "\#include \"paddle/fluid/framework/ir/pass.h\"\n")
copy_if_different(${pass_file} ${pass_file_final} extern_glog) copy_if_different(${pass_file} ${pass_file_final})
add_subdirectory(fuse_optimizer_ops_pass) add_subdirectory(fuse_optimizer_ops_pass)
add_subdirectory(memory_optimize_pass) add_subdirectory(memory_optimize_pass)
......
...@@ -7,7 +7,7 @@ set(pybind_file ${PADDLE_BINARY_DIR}/paddle/fluid/pybind/pybind.h.tmp CACHE INTE ...@@ -7,7 +7,7 @@ set(pybind_file ${PADDLE_BINARY_DIR}/paddle/fluid/pybind/pybind.h.tmp CACHE INTE
set(pybind_file_final ${PADDLE_BINARY_DIR}/paddle/fluid/pybind/pybind.h) set(pybind_file_final ${PADDLE_BINARY_DIR}/paddle/fluid/pybind/pybind.h)
file(WRITE ${pybind_file} "// Generated by the paddle/fluid/operators/CMakeLists.txt. DO NOT EDIT!\n\n") file(WRITE ${pybind_file} "// Generated by the paddle/fluid/operators/CMakeLists.txt. DO NOT EDIT!\n\n")
copy_if_different(${pybind_file} ${pybind_file_final} operator) copy_if_different(${pybind_file} ${pybind_file_final})
add_subdirectory(math) add_subdirectory(math)
add_subdirectory(controlflow) add_subdirectory(controlflow)
......
...@@ -12,7 +12,7 @@ file(GLOB jit_kernel_cc_srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.cc") ...@@ -12,7 +12,7 @@ file(GLOB jit_kernel_cc_srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.cc")
list(REMOVE_ITEM jit_kernel_cc_srcs test.cc benchmark.cc) list(REMOVE_ITEM jit_kernel_cc_srcs test.cc benchmark.cc)
cc_library(jit_kernel_base SRCS ${jit_kernel_cc_srcs} DEPS ${JIT_KERNEL_DEPS}) cc_library(jit_kernel_base SRCS ${jit_kernel_cc_srcs} DEPS ${JIT_KERNEL_DEPS})
copy_if_different(${jit_file} ${jit_file_final} jit_kernel_base) copy_if_different(${jit_file} ${jit_file_final})
# refer must go first # refer must go first
add_subdirectory(refer) add_subdirectory(refer)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册