diff --git a/chdb/build/build_static_lib.sh b/chdb/build/build_static_lib.sh index ca7b20432bf..d82459d28eb 100755 --- a/chdb/build/build_static_lib.sh +++ b/chdb/build/build_static_lib.sh @@ -8,7 +8,11 @@ MY_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" . ${MY_DIR}/../vars.sh -BUILD_DIR=${PROJ_DIR}/build-static-lib +if [ "$(uname)" == "Darwin" ] && [ "$(uname -m)" == "x86_64" ]; then + BUILD_DIR=${PROJ_DIR}/buildlib +else + BUILD_DIR=${PROJ_DIR}/build-static-lib +fi HDFS="-DENABLE_HDFS=1 -DENABLE_GSASL_LIBRARY=1 -DENABLE_KRB5=1" MYSQL="-DENABLE_MYSQL=1" diff --git a/chdb/build/create_static_libchdb.py b/chdb/build/create_static_libchdb.py index 5110946fe2d..c8746fd1c43 100755 --- a/chdb/build/create_static_libchdb.py +++ b/chdb/build/create_static_libchdb.py @@ -33,9 +33,16 @@ def parse_libchdb_cmd(): script_dir = os.path.dirname(os.path.abspath(__file__)) project_root = os.path.dirname(os.path.dirname(script_dir)) + if IS_MACOS_X86: + build_dir = 'buildlib' + else: + build_dir = 'build-static-lib' + + print(f"Using build directory: {build_dir}") + # First, check build.log to see if it contains @CMakeFiles/clickhouse.rsp - build_log_path = os.path.join(project_root, 'build-static-lib', 'build.log') - rsp_file_path = os.path.join(project_root, 'build-static-lib', 'CMakeFiles', 'clickhouse.rsp') + build_log_path = os.path.join(project_root, build_dir, 'build.log') + rsp_file_path = os.path.join(project_root, build_dir, 'CMakeFiles', 'clickhouse.rsp') command = "" use_rsp_file = False @@ -68,7 +75,7 @@ def parse_libchdb_cmd(): print("=== END COMMAND ===\n") # Common prefix for absolute paths - base_path = os.path.join(project_root, "build-static-lib") + base_path = os.path.join(project_root, build_dir) # Extract all .o files and .a files from the command # Pattern for .o files (must be followed by space or end of string)