|
|
|
@ -57,8 +57,11 @@ function(cc_binary TARGET_NAME)
|
|
|
|
|
set(multiValueArgs SRCS DEPS)
|
|
|
|
|
cmake_parse_arguments(cc_binary "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
|
|
|
|
add_executable(${TARGET_NAME} ${cc_binary_SRCS})
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${cc_binary_DEPS} ${external_project_dependencies})
|
|
|
|
|
target_link_libraries(${TARGET_NAME} ${cc_binary_DEPS} ${CMAKE_THREAD_LIBS_INIT})
|
|
|
|
|
link_paddle_exe(${TARGET_NAME})
|
|
|
|
|
if(cc_binary_DEPS)
|
|
|
|
|
target_link_libraries(${TARGET_NAME} ${cc_binary_DEPS})
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${cc_binary_DEPS})
|
|
|
|
|
endif()
|
|
|
|
|
endfunction(cc_binary)
|
|
|
|
|
|
|
|
|
|
# The dependency to target tensor implies that if any of
|
|
|
|
@ -74,12 +77,11 @@ function(cc_test TARGET_NAME)
|
|
|
|
|
set(multiValueArgs SRCS DEPS)
|
|
|
|
|
cmake_parse_arguments(cc_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
|
|
|
|
add_executable(${TARGET_NAME} ${cc_test_SRCS})
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${cc_test_DEPS} ${external_project_dependencies})
|
|
|
|
|
target_link_libraries(${TARGET_NAME}
|
|
|
|
|
${cc_test_DEPS}
|
|
|
|
|
${GTEST_MAIN_LIBRARIES}
|
|
|
|
|
${GTEST_LIBRARIES}
|
|
|
|
|
${CMAKE_THREAD_LIBS_INIT})
|
|
|
|
|
link_paddle_test(${TARGET_NAME})
|
|
|
|
|
if(cc_test_DEPS)
|
|
|
|
|
target_link_libraries(${TARGET_NAME} ${cc_test_DEPS})
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${cc_test_DEPS})
|
|
|
|
|
endif()
|
|
|
|
|
add_test(${TARGET_NAME} ${TARGET_NAME})
|
|
|
|
|
endfunction(cc_test)
|
|
|
|
|
|
|
|
|
@ -110,8 +112,11 @@ function(nv_binary TARGET_NAME)
|
|
|
|
|
set(multiValueArgs SRCS DEPS)
|
|
|
|
|
cmake_parse_arguments(nv_binary "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
|
|
|
|
cuda_add_executable(${TARGET_NAME} ${nv_binary_SRCS})
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${nv_binary_DEPS} ${external_project_dependencies})
|
|
|
|
|
target_link_libraries(${TARGET_NAME} ${nv_binary_DEPS} ${CMAKE_THREAD_LIBS_INIT})
|
|
|
|
|
link_paddle_exe(${TARGET_NAME})
|
|
|
|
|
if(nv_binary_DEPS)
|
|
|
|
|
target_link_libraries(${TARGET_NAME} ${nv_binary_DEPS})
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${nv_binary_DEPS})
|
|
|
|
|
endif()
|
|
|
|
|
endfunction(nv_binary)
|
|
|
|
|
|
|
|
|
|
# The dependency to target tensor implies that if any of
|
|
|
|
@ -127,12 +132,11 @@ function(nv_test TARGET_NAME)
|
|
|
|
|
set(multiValueArgs SRCS DEPS)
|
|
|
|
|
cmake_parse_arguments(nv_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
|
|
|
|
cuda_add_executable(${TARGET_NAME} ${nv_test_SRCS})
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${nv_test_DEPS} ${external_project_dependencies})
|
|
|
|
|
target_link_libraries(${TARGET_NAME}
|
|
|
|
|
${nv_test_DEPS}
|
|
|
|
|
${GTEST_MAIN_LIBRARIES}
|
|
|
|
|
${GTEST_LIBRARIES}
|
|
|
|
|
${CMAKE_THREAD_LIBS_INIT})
|
|
|
|
|
link_paddle_test(${TARGET_NAME})
|
|
|
|
|
if(nv_test_DEPS)
|
|
|
|
|
target_link_libraries(${TARGET_NAME} ${nv_test_DEPS})
|
|
|
|
|
add_dependencies(${TARGET_NAME} ${nv_test_DEPS})
|
|
|
|
|
endif()
|
|
|
|
|
add_test(${TARGET_NAME} ${TARGET_NAME})
|
|
|
|
|
endfunction(nv_test)
|
|
|
|
|
|
|
|
|
|