|
|
|
@ -110,6 +110,14 @@ function(find_fluid_modules TARGET_NAME)
|
|
|
|
|
endif()
|
|
|
|
|
endfunction(find_fluid_modules)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function(common_link TARGET_NAME)
|
|
|
|
|
if (WITH_PROFILER)
|
|
|
|
|
target_link_libraries(${TARGET_NAME} gperftools::profiler)
|
|
|
|
|
endif()
|
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# find all third_party modules is used for paddle static library
|
|
|
|
|
# for reduce the dependency when building the inference libs.
|
|
|
|
|
set_property(GLOBAL PROPERTY FLUID_THIRD_PARTY)
|
|
|
|
@ -274,6 +282,7 @@ function(cc_library TARGET_NAME)
|
|
|
|
|
endif()
|
|
|
|
|
target_link_libraries(${TARGET_NAME} ${cc_library_DEPS})
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${cc_library_DEPS})
|
|
|
|
|
common_link(${TARGET_NAME})
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# cpplint code style
|
|
|
|
@ -340,6 +349,7 @@ function(cc_binary TARGET_NAME)
|
|
|
|
|
if(cc_binary_DEPS)
|
|
|
|
|
target_link_libraries(${TARGET_NAME} ${cc_binary_DEPS})
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${cc_binary_DEPS})
|
|
|
|
|
common_link(${TARGET_NAME})
|
|
|
|
|
endif()
|
|
|
|
|
endfunction(cc_binary)
|
|
|
|
|
|
|
|
|
@ -362,6 +372,7 @@ function(cc_test TARGET_NAME)
|
|
|
|
|
target_link_libraries(${TARGET_NAME} ${win32_deps})
|
|
|
|
|
endif(WIN32)
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog)
|
|
|
|
|
common_link(${TARGET_NAME})
|
|
|
|
|
add_test(NAME ${TARGET_NAME}
|
|
|
|
|
COMMAND ${TARGET_NAME} ${cc_test_ARGS}
|
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
@ -420,6 +431,7 @@ function(nv_binary TARGET_NAME)
|
|
|
|
|
if(nv_binary_DEPS)
|
|
|
|
|
target_link_libraries(${TARGET_NAME} ${nv_binary_DEPS})
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${nv_binary_DEPS})
|
|
|
|
|
common_link(${TARGET_NAME})
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
endfunction(nv_binary)
|
|
|
|
@ -433,6 +445,7 @@ function(nv_test TARGET_NAME)
|
|
|
|
|
cuda_add_executable(${TARGET_NAME} ${nv_test_SRCS})
|
|
|
|
|
target_link_libraries(${TARGET_NAME} ${nv_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog)
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${nv_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog)
|
|
|
|
|
common_link(${TARGET_NAME})
|
|
|
|
|
add_test(${TARGET_NAME} ${TARGET_NAME})
|
|
|
|
|
if (nv_test_SERIAL)
|
|
|
|
|
set_property(TEST ${TARGET_NAME} PROPERTY RUN_SERIAL 1)
|
|
|
|
@ -499,6 +512,7 @@ function(hip_binary TARGET_NAME)
|
|
|
|
|
if(hip_binary_DEPS)
|
|
|
|
|
target_link_libraries(${TARGET_NAME} ${hip_binary_DEPS})
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${hip_binary_DEPS})
|
|
|
|
|
common_link(${TARGET_NAME})
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
endfunction(hip_binary)
|
|
|
|
@ -518,6 +532,7 @@ function(hip_test TARGET_NAME)
|
|
|
|
|
set_target_properties(${TARGET_NAME} PROPERTIES LINKER_LANGUAGE HIP)
|
|
|
|
|
target_link_libraries(${TARGET_NAME} ${hip_test_DEPS} paddle_gtest_main memory gtest gflags)
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${hip_test_DEPS} paddle_gtest_main memory gtest gflags)
|
|
|
|
|
common_link(${TARGET_NAME})
|
|
|
|
|
add_test(${TARGET_NAME} ${TARGET_NAME})
|
|
|
|
|
endif()
|
|
|
|
|
endfunction(hip_test)
|
|
|
|
@ -560,6 +575,7 @@ function(go_library TARGET_NAME)
|
|
|
|
|
endif()
|
|
|
|
|
if(go_library_DEPS)
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${go_library_DEPS})
|
|
|
|
|
common_link(${TARGET_NAME})
|
|
|
|
|
endif(go_library_DEPS)
|
|
|
|
|
|
|
|
|
|
# The "source file" of the library is `${dummyfile}` which never
|
|
|
|
|