未验证 提交 ff642c68 编写于 作者: C Chen Weihang 提交者: GitHub

[Cherry-pick] Fix python link error (#47811)

* Fix Python Link Order Error (#46259)

* fix cc_library link python lib (#47605)

* fix cc_library link python lib
Co-authored-by: engineer1109's avatarengineer <1292846099@qq.com>
Co-authored-by: Nwanghuancoder <wanghuan29@baidu.com>
上级 76b883c2
......@@ -262,6 +262,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
......@@ -601,4 +605,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.
先完成此消息的编辑!
想要评论请 注册