Skip to content

Commit

Permalink
Copy so file before striping it
Browse files Browse the repository at this point in the history
  • Loading branch information
tobegit3hub committed Jan 21, 2022
1 parent e208d2a commit ae7cd5f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sdk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,16 @@ if(SQL_PYSDK_ENABLE)
if(APPLE)
set(PYTHON_PLATFORM macosx_10_15_x86_64)
add_custom_target(strip_python_so ALL DEPENDS sql_router_sdk
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:sql_router_sdk> ${PROJECT_SOURCE_DIR}/python/openmldb_native/
COMMAND echo "Do not strip library for MacOS, refer to https://github.com/4paradigm/OpenMLDB/issues/905")
else()
set(PYTHON_PLATFORM manylinux1_x86_64)
add_custom_target(strip_python_so ALL DEPENDS sql_router_sdk
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:sql_router_sdk> ${PROJECT_SOURCE_DIR}/python/openmldb_native/
COMMAND strip ${PROJECT_SOURCE_DIR}/python/openmldb_native/_sql_router_sdk.so)
endif()

add_custom_target(cp_python_sdk_so ALL DEPENDS strip_python_so
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:sql_router_sdk> ${PROJECT_SOURCE_DIR}/python/openmldb_native/
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/sql_pysdk/openmldb/sql_router_sdk.py ${PROJECT_SOURCE_DIR}/python/openmldb_native/
COMMENT "copy generated native library and sql_router_sdk python file to python project"
COMMAND cd ${PROJECT_SOURCE_DIR}/python/ && ${Python3_EXECUTABLE} setup.py bdist_wheel --plat-name ${PYTHON_PLATFORM}
Expand Down

0 comments on commit ae7cd5f

Please sign in to comment.