Skip to content

Commit 11a8c99

Browse files
authored
Merge pull request #404 from wudidapaopao/fix_static_build
build_static_lib and build use same build output dir
2 parents 6ba53a7 + 7a08189 commit 11a8c99

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

chdb/build/build_static_lib.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ MY_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
88

99
. ${MY_DIR}/../vars.sh
1010

11-
BUILD_DIR=${PROJ_DIR}/build-static-lib
11+
if [ "$(uname)" == "Darwin" ] && [ "$(uname -m)" == "x86_64" ]; then
12+
BUILD_DIR=${PROJ_DIR}/buildlib
13+
else
14+
BUILD_DIR=${PROJ_DIR}/build-static-lib
15+
fi
1216

1317
HDFS="-DENABLE_HDFS=1 -DENABLE_GSASL_LIBRARY=1 -DENABLE_KRB5=1"
1418
MYSQL="-DENABLE_MYSQL=1"

chdb/build/create_static_libchdb.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,16 @@ def parse_libchdb_cmd():
3333
script_dir = os.path.dirname(os.path.abspath(__file__))
3434
project_root = os.path.dirname(os.path.dirname(script_dir))
3535

36+
if IS_MACOS_X86:
37+
build_dir = 'buildlib'
38+
else:
39+
build_dir = 'build-static-lib'
40+
41+
print(f"Using build directory: {build_dir}")
42+
3643
# First, check build.log to see if it contains @CMakeFiles/clickhouse.rsp
37-
build_log_path = os.path.join(project_root, 'build-static-lib', 'build.log')
38-
rsp_file_path = os.path.join(project_root, 'build-static-lib', 'CMakeFiles', 'clickhouse.rsp')
44+
build_log_path = os.path.join(project_root, build_dir, 'build.log')
45+
rsp_file_path = os.path.join(project_root, build_dir, 'CMakeFiles', 'clickhouse.rsp')
3946

4047
command = ""
4148
use_rsp_file = False
@@ -68,7 +75,7 @@ def parse_libchdb_cmd():
6875
print("=== END COMMAND ===\n")
6976

7077
# Common prefix for absolute paths
71-
base_path = os.path.join(project_root, "build-static-lib")
78+
base_path = os.path.join(project_root, build_dir)
7279

7380
# Extract all .o files and .a files from the command
7481
# Pattern for .o files (must be followed by space or end of string)

0 commit comments

Comments
 (0)