未验证 提交 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) ...@@ -388,8 +388,7 @@ function(cc_library TARGET_NAME)
target_link_libraries(${TARGET_NAME} "-Wl,-undefined,dynamic_lookup") target_link_libraries(${TARGET_NAME} "-Wl,-undefined,dynamic_lookup")
endif() endif()
endif() endif()
target_link_libraries(${TARGET_NAME} ${cc_library_DEPS} target_link_libraries(${TARGET_NAME} ${cc_library_DEPS})
${PYTHON_LIBRARIES})
common_link(${TARGET_NAME}) common_link(${TARGET_NAME})
endif() endif()
......
...@@ -296,6 +296,10 @@ if(WITH_PYTHON) ...@@ -296,6 +296,10 @@ if(WITH_PYTHON)
list(APPEND OP_FUNCTION_GENERETOR_DEPS cncl_context) list(APPEND OP_FUNCTION_GENERETOR_DEPS cncl_context)
endif() 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) add_executable(op_function_generator op_function_generator.cc)
target_link_libraries(op_function_generator ${OP_FUNCTION_GENERETOR_DEPS}) target_link_libraries(op_function_generator ${OP_FUNCTION_GENERETOR_DEPS})
add_executable(eager_legacy_op_function_generator add_executable(eager_legacy_op_function_generator
...@@ -650,4 +654,6 @@ if(WITH_PYTHON) ...@@ -650,4 +654,6 @@ if(WITH_PYTHON)
get_property(os_dependency_modules GLOBAL PROPERTY OS_DEPENDENCY_MODULES) get_property(os_dependency_modules GLOBAL PROPERTY OS_DEPENDENCY_MODULES)
target_link_libraries(${SHARD_LIB_NAME} ${os_dependency_modules}) target_link_libraries(${SHARD_LIB_NAME} ${os_dependency_modules})
add_dependencies(${SHARD_LIB_NAME} op_function_generator_cmd) add_dependencies(${SHARD_LIB_NAME} op_function_generator_cmd)
target_link_libraries(${SHARD_LIB_NAME} ${PYTHON_LIBRARIES})
endif() endif()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册