diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f21c8b263a68c8755ee96972f56c63f21809095e..af6dc423561e7dc7210789c3033c512fc2d42af3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -168,7 +168,9 @@ if(${len} GREATER_EQUAL 1) add_executable(${test_name} ${test_src}) target_link_libraries(${test_name} paddle_gtest_main_new) target_link_libraries(${test_name} $) - target_link_libraries(${test_name} $) + if(WITH_SHARED_PHI) + target_link_libraries(${test_name} $) + endif() add_dependencies(${test_name} ${paddle_lib} paddle_gtest_main_new) if(WITH_GPU) target_link_libraries(${test_name} ${CUDA_CUDART_LIBRARY}