File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -73,8 +73,12 @@ function(cinn_cc_test TARGET_NAME)
73
73
add_executable (${TARGET_NAME} ${cinn_cc_test_SRCS} )
74
74
get_property (os_dependency_modules GLOBAL PROPERTY OS_DEPENDENCY_MODULES )
75
75
target_link_libraries (${TARGET_NAME} ${os_dependency_modules}
76
- cinn_gtest_main gtest glog ${cinn_cc_test_DEPS} )
77
- add_dependencies (${TARGET_NAME} cinn_gtest_main gtest glog
76
+ paddle_gtest_main gtest glog ${cinn_cc_test_DEPS} )
77
+ if (WITH_SHARED_PHI )
78
+ target_link_libraries (${TARGET_NAME} -Wl,--as-needed phi_core phi_gpu
79
+ -Wl,--no-as-needed )
80
+ endif ()
81
+ add_dependencies (${TARGET_NAME} paddle_gtest_main gtest glog
78
82
${cinn_cc_test_DEPS} )
79
83
80
84
add_test (
@@ -159,13 +163,18 @@ function(cinn_nv_test TARGET_NAME)
159
163
target_link_libraries (
160
164
${TARGET_NAME}
161
165
${cinn_nv_test_DEPS}
162
- cinn_gtest_main
166
+ paddle_gtest_main
163
167
gtest
164
168
${os_dependency_modules}
165
169
${CUDNN_LIBRARY}
166
170
${CUBLAS_LIBRARIES}
167
171
${CUDA_LIBRARIES} )
168
- add_dependencies (${TARGET_NAME} ${cinn_nv_test_DEPS} cinn_gtest_main gtest )
172
+ if (WITH_SHARED_PHI )
173
+ target_link_libraries (${TARGET_NAME} -Wl,--as-needed phi_core phi_gpu
174
+ -Wl,--no-as-needed )
175
+ endif ()
176
+ add_dependencies (${TARGET_NAME} ${cinn_nv_test_DEPS} paddlec_gtest_main
177
+ gtest )
169
178
common_link (${TARGET_NAME} )
170
179
add_test (
171
180
NAME ${TARGET_NAME}
Original file line number Diff line number Diff line change @@ -599,8 +599,9 @@ function(paddle_test_build TARGET_NAME)
599
599
target_link_libraries (${TARGET_NAME} ${PYTHON_LIBRARIES} )
600
600
endif ()
601
601
if (WITH_CINN )
602
- target_link_libraries (${TARGET_NAME} $< TARGET_LINKER_FILE:cinnapi>
603
- cinn_transforms )
602
+ target_link_libraries (${TARGET_NAME} -Wl,--as-needed cinnapi
603
+ -Wl,--no-as-needed )
604
+ target_link_libraries (${TARGET_NAME} cinn_transforms )
604
605
add_dependencies (${TARGET_NAME} cinnapi )
605
606
endif ()
606
607
if (WITH_XPU )
You can’t perform that action at this time.
0 commit comments