Skip to content

Commit d3788bf

Browse files
committed
Fixed
Signed-off-by: Adam Li <adam2392@gmail.com>
1 parent ee4b9b7 commit d3788bf

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ endif
4444

4545
tempita = files('sklearn/_build_utils/tempita.py')
4646

47+
option('enable_custom_target', type: 'boolean', value: true, description: 'Enable custom target')
48+
4749
py = import('python').find_installation(pure: false)
4850

4951
# Copy all the .py files to the install dir, rather than using

sklearn/meson.build

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,16 @@ cython_args += scikit_learn_cython_args
193193
# Write file in Meson build dir to be able to figure out from Python code
194194
# whether scikit-learn was built with Meson. Adapted from pandas
195195
# _version_meson.py.
196-
custom_target('write_built_with_meson_file',
197-
output: '_built_with_meson.py',
198-
command: [
199-
py, '-c', 'with open("sklearn/_built_with_meson.py", "w") as f: f.write("")'
200-
],
201-
install: true,
202-
install_dir: py.get_install_dir() / 'sklearn'
203-
)
196+
if get_option('enable_custom_target')
197+
custom_target('write_built_with_meson_file',
198+
output: '_built_with_meson.py',
199+
command: [
200+
py, '-c', 'with open("sklearn/_built_with_meson.py", "w") as f: f.write("")'
201+
],
202+
install: true,
203+
install_dir: py.get_install_dir() / 'sklearn'
204+
)
205+
endif
204206

205207
extensions = ['_isotonic']
206208

0 commit comments

Comments
 (0)