diff --git a/package/apk/seekdb-apk-build.sh b/package/apk/seekdb-apk-build.sh index 1c8896424..49658c524 100644 --- a/package/apk/seekdb-apk-build.sh +++ b/package/apk/seekdb-apk-build.sh @@ -497,8 +497,8 @@ if [[ "$DO_MAKE" == true ]]; then cd "$TOPDIR" echo "[seekdb-apk-build] ./build.sh clean" ./build.sh clean - echo "[seekdb-apk-build] ./build.sh release --android --init" - ./build.sh release --android --init + echo "[seekdb-apk-build] ./build.sh release --android --init -DBUILD_EMBED_MODE=ON" + ./build.sh release --android --init -DBUILD_EMBED_MODE=ON cd "$TOPDIR" _jobs="$(getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)" if [[ "$WITH_JNI" == true ]]; then @@ -614,3 +614,4 @@ if [[ "$DO_INSTALL" == true ]]; then fi echo "[package_embedded_apk] done" + diff --git a/src/observer/embed/CMakeLists.txt b/src/observer/embed/CMakeLists.txt index c557a0861..b17dbfa4c 100644 --- a/src/observer/embed/CMakeLists.txt +++ b/src/observer/embed/CMakeLists.txt @@ -35,26 +35,26 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android") target_link_libraries(embedded_client PRIVATE seekdb_embed_c) endif() -if(BUILD_EMBED_MODE) +if(BUILD_EMBED_MODE AND NOT CMAKE_SYSTEM_NAME STREQUAL "Android") # Set target Python version, can be overridden by CMake parameter if(NOT DEFINED PYTHON_VERSION) set(PYTHON_VERSION "3.8") endif() set(Python3_FOUND FALSE) - + message(STATUS "Target Python version: ${PYTHON_VERSION}") - + # First try to find the specified Python version from system message(STATUS "Searching for Python ${PYTHON_VERSION} in system first...") find_package(Python3 ${PYTHON_VERSION} EXACT COMPONENTS Interpreter Development.Module QUIET) if(Python3_FOUND) message(STATUS "Found system Python ${PYTHON_VERSION}, using it for embed module") endif() - + # If system doesn't have the specified Python version, try to find from pyenv if(NOT Python3_FOUND) message(STATUS "No system Python ${PYTHON_VERSION} found, trying pyenv...") - + # Method 1: Check if pyenv version can be specified via environment variable if(DEFINED ENV{PYENV_VERSION}) execute_process( @@ -79,7 +79,7 @@ if(BUILD_EMBED_MODE) endif() endif() endif() - + # Method 2: Directly try to find the specified version in pyenv if(NOT Python3_FOUND) execute_process( @@ -119,7 +119,7 @@ if(BUILD_EMBED_MODE) endif() endif() endif() - + # Method 3: Directly find the specified version through PYENV_ROOT if(NOT Python3_FOUND AND DEFINED ENV{PYENV_ROOT}) set(PYENV_SPECIFIC_PYTHON "$ENV{PYENV_ROOT}/versions/${PYTHON_VERSION}/bin/python") @@ -130,12 +130,12 @@ if(BUILD_EMBED_MODE) endif() endif() endif() - + # If still no suitable Python version found, error and exit if(NOT Python3_FOUND) message(FATAL_ERROR "No suitable Python ${PYTHON_VERSION} found. Please install Python ${PYTHON_VERSION} or configure pyenv with Python ${PYTHON_VERSION}.") endif() - + # Verify the final Python choice if(Python3_EXECUTABLE) execute_process( @@ -145,7 +145,7 @@ if(BUILD_EMBED_MODE) ) message(STATUS "Final Python choice: ${Python3_EXECUTABLE} (${PYTHON_VERSION_OUTPUT})") endif() - + message(STATUS "Building embed module with Python ${Python3_EXECUTABLE}") execute_process( COMMAND "${Python3_EXECUTABLE}" -c @@ -194,7 +194,7 @@ if(BUILD_EMBED_MODE) SUFFIX ".so" OUTPUT_NAME "${libname}" ) - + target_link_libraries(${libname} PUBLIC oceanbase_static $<$>:-static-libgcc>