Skip to content

Commit 989df1b

Browse files
committed
remove --build-dir option and fix --clean option
1 parent 32f1509 commit 989df1b

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

scripts/_build_helper.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Data Parallel Control (dpctl)
22
#
3-
# Copyright 2020-2025 Intel Corporation
3+
# Copyright 2025 Intel Corporation
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -121,7 +121,8 @@ def install_editable(setup_dir, env):
121121
)
122122

123123

124-
def clean_build_dir(build_dir):
125-
if os.path.exists(build_dir):
126-
print(f"Cleaning build directory: {build_dir}")
127-
shutil.rmtree(build_dir)
124+
def clean_build_dir(setup_dir):
125+
target = os.path.join(setup_dir or os.getcwd(), "_skbuild")
126+
if os.path.exists(target):
127+
print(f"Cleaning build directory: {target}")
128+
shutil.rmtree(target)

scripts/build_locally.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,9 @@ def parse_args():
121121
help="Enable HIP backend. Architecture required to be specified.",
122122
)
123123

124-
p.add_argument(
125-
"--build-dir",
126-
default="build",
127-
help="CMake build directory (default: build)",
128-
)
129124
p.add_argument(
130125
"--clean",
131-
action="store_false",
126+
action="store_true",
132127
help="Remove build dir before rebuild (default: False)",
133128
)
134129
p.add_argument(
@@ -145,15 +140,14 @@ def main():
145140
err(f"{sys.platform} not supported")
146141
args = parse_args()
147142
setup_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
148-
build_dir = os.path.join(setup_dir, args.build_dir)
149143

150144
c_compiler, cxx_compiler, compiler_root = resolve_compilers(
151145
args.oneapi, args.c_compiler, args.cxx_compiler, args.compiler_root
152146
)
153147

154148
# clean build dir if --clean set
155149
if args.clean:
156-
clean_build_dir(build_dir)
150+
clean_build_dir(setup_dir)
157151

158152
if args.no_level_zero and args.target_level_zero:
159153
err("Cannot combine --no-level-zero and --target-level-zero")

0 commit comments

Comments
 (0)