8000 Minor changes to meson.build · r-devulap/numpy@e0f0247 · GitHub
[go: up one dir, main page]

Skip to content

Commit e0f0247

Browse files
committed
Minor changes to meson.build
1 parent 8ba425e commit e0f0247

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

numpy/_core/meson.build

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,18 @@ if use_intel_sort and not fs.exists('src/npysort/x86-simd-sort/README.md')
128128
error('Missing the `x86-simd-sort` git submodule! Run `git submodule update --init` to fix this.')
129129
endif
130130

131-
use_openmp = not get_option('disable-threading') and get_option('enable-openmp') and cpp.has_argument('-fopenmp')
132-
summary({
133-
'Build with openMP? ' : use_openmp,
134-
})
131+
# openMP related settings:
132+
if get_option('disable-threading') and get_option('enable-openmp')
133+
error('Build options `disable-threading` and `enable-openmp` are conflicting. Please set at most one to true.')
134+
endif
135+
136+
use_openmp = get_option('enable-openmp') and not get_option('disable-threading')
135137

136138
# Setup openmp flags for x86-simd-sort:
137-
omp_cflags = []
138-
omp = []
139+
omp_dep = []
139140
if use_intel_sort and use_openmp
140-
omp = dependency('openmp', required : false)
141-
if omp.found()
142-
omp_cflags = ['-fopenmp', '-DXSS_USE_OPENMP']
143-
endif
141+
omp = dependency('openmp', required : true)
142+
omp_dep = declare_dependency(dependencies: omp, compile_args: ['-DXSS_USE_OPENMP'])
144143
endif
145144

146145
if not fs.exists('src/common/pythoncapi-compat')
@@ -890,9 +889,9 @@ foreach gen_mtargets : [
890889
dispatch: gen_mtargets[2],
891890
# baseline: CPU_BASELINE, it doesn't provide baseline fallback
892891
prefix: 'NPY_',
893-
dependencies: [py_dep, np_core_dep],
892+
dependencies: [py_dep, np_core_dep, omp_dep],
894893
c_args: c_args_common + max_opt,
895-
cpp_args: cpp_args_common + max_opt + omp_cflags,
894+
cpp_args: cpp_args_common + max_opt,
896895
include_directories: [
897896
'include',
898897
'src/common',

0 commit comments

Comments
 (0)
0