已合并
fix opHost\opGraph UT #1548
chenyifeng创建于 2月5日
fix opHost\opGraph UT #1548
已合并
chenyifeng创建于 2月5日
2 个文件变更+9-2
@@ -18,7 +18,7 @@ using namespace std;
18 18 
19#ifdef __aarch64__19#ifdef __aarch64__
20const string CPU_ARCH_STR = "aarch64";20const string CPU_ARCH_STR = "aarch64";
21-#elif define(__x86_64__)21+#elif defined(__x86_64__)
22const string CPU_ARCH_STR = "x86_64";22const string CPU_ARCH_STR = "x86_64";
23#endif23#endif
24 24 
@@ -19,8 +19,15 @@ if(UT_TEST_ALL OR OP_HOST_UT OR OP_GRAPH_UT)
19 endforeach()19 endforeach()
20 20 
21 ## add ophost_nn_ut so21 ## add ophost_nn_ut so
22+ if(TARGET ${OPHOST_NAME}_infer_obj)
23+ message(STATUS "Found infershape file.")
24+ set(OPHOST_INFER_OBJ_SRCS $<TARGET_OBJECTS:${OPHOST_NAME}_infer_obj>)
25+ else()
26+ message(WARNING "Infershape file Not Found.")
27+ set(OPHOST_INFER_OBJ_SRCS "${CMAKE_SOURCE_DIR}/tests/ut/op_api/empty_runtime.cpp")
28+ endif()
22 add_library(ophost_${PKG_NAME}_ut SHARED29 add_library(ophost_${PKG_NAME}_ut SHARED
23- $<$<TARGET_EXISTS:${OPHOST_NAME}_infer_obj>:$<TARGET_OBJECTS:${OPHOST_NAME}_infer_obj>>30+ ${OPHOST_INFER_OBJ_SRCS}
24 )31 )
25 target_compile_options(ophost_${PKG_NAME}_ut PRIVATE -fPIC)32 target_compile_options(ophost_${PKG_NAME}_ut PRIVATE -fPIC)
26 target_compile_definitions(ophost_${PKG_NAME}_ut PRIVATE LOG_CPP)33 target_compile_definitions(ophost_${PKG_NAME}_ut PRIVATE LOG_CPP)