未验证 提交 cd59c10c 编写于 作者: W wanghuancoder 提交者: GitHub

fix cc_library link python lib (#47605)

* fix cc_library link python lib
上级 aa669c74
......@@ -388,8 +388,7 @@ function(cc_library TARGET_NAME)
target_link_libraries(${TARGET_NAME} "-Wl,-undefined,dynamic_lookup")
endif()
endif()
target_link_libraries(${TARGET_NAME} ${cc_library_DEPS}
${PYTHON_LIBRARIES})
target_link_libraries(${TARGET_NAME} ${cc_library_DEPS})
common_link(${TARGET_NAME})
endif()
......
......@@ -296,6 +296,10 @@ if(WITH_PYTHON)
list(APPEND OP_FUNCTION_GENERETOR_DEPS cncl_context)
endif()
if(NOT ((NOT WITH_PYTHON) AND ON_INFER))
list(APPEND OP_FUNCTION_GENERETOR_DEPS ${PYTHON_LIBRARIES})
endif()
add_executable(op_function_generator op_function_generator.cc)
target_link_libraries(op_function_generator ${OP_FUNCTION_GENERETOR_DEPS})
add_executable(eager_legacy_op_function_generator
......@@ -650,4 +654,6 @@ if(WITH_PYTHON)
get_property(os_dependency_modules GLOBAL PROPERTY OS_DEPENDENCY_MODULES)
target_link_libraries(${SHARD_LIB_NAME} ${os_dependency_modules})
add_dependencies(${SHARD_LIB_NAME} op_function_generator_cmd)
target_link_libraries(${SHARD_LIB_NAME} ${PYTHON_LIBRARIES})
endif()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册