diff --git a/paddle/contrib/inference/CMakeLists.txt b/paddle/contrib/inference/CMakeLists.txt index 75dbfb62554610166444fb6acc055a2e45ebd825..8562bea0ed30f0420d056814d56372fe67140e7b 100644 --- a/paddle/contrib/inference/CMakeLists.txt +++ b/paddle/contrib/inference/CMakeLists.txt @@ -61,11 +61,11 @@ if(NOT APPLE) "if(NOT \"\${symbol_res}\" STREQUAL \"0\")\n" " message(FATAL_ERROR \"Check symbol failed.\")\n" "endif()\n") - add_custom_target(check_symbol ALL) add_custom_command( - TARGET check_symbol - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/check_symbol.cmake + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/.check_symbol + COMMAND ${CMAKE_COMMAND} -P ${cmake_current_binary_dir}/check_symbol.cmake DEPENDS paddle_inference_api_shared) + add_custom_target(check_symbol ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/.check_symbol) endif() cc_test(test_paddle_inference_api