Skip to content

Commit 46a3e78

Browse files
committed
Also compile pbori with c+11 for old boost
1 parent 4b199fe commit 46a3e78

File tree

3 files changed

+36
-22
lines changed

3 files changed

+36
-22
lines changed

src/meson.build

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,27 @@ endif
214214
# Cannot be found via pkg-config
215215
ntl = cc.find_library('ntl', required: not is_windows, disabler: true)
216216

217+
boost_cpp17_compatible = false
218+
boost = dependency(
219+
'boost',
220+
version: '>=1.83.0',
221+
required: false,
222+
modules: ['graph', 'tuple'],
223+
)
224+
if boost.found()
225+
# Need at least v1.83.0 (https://github.com/boostorg/functional/commit/6a573e4b8333ee63ee62ce95558c3667348db233)
226+
# for C++17 compatibility.
227+
boost_cpp17_compatible = true
228+
else
229+
boost = dependency(
230+
'boost',
231+
version: '>=1.66.0',
232+
required: false,
233+
modules: ['graph', 'tuple'],
234+
)
235+
endif
236+
237+
217238
# Meson currently ignores include_directories for Cython modules, so we
218239
# have to add them manually.
219240
# https://github.com/mesonbuild/meson/issues/9562

src/sage/graphs/base/meson.build

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
1-
boost_cpp17_compatible = false
2-
boost = dependency(
3-
'boost',
4-
version: '>=1.83.0',
5-
required: false,
6-
modules: ['graph', 'tuple'],
7-
)
8-
if boost.found()
9-
# Need at least v1.83.0 (https://github.com/boostorg/functional/commit/6a573e4b8333ee63ee62ce95558c3667348db233)
10-
# for C++17 compatibility.
11-
boost_cpp17_compatible = true
12-
else
13-
boost = dependency(
14-
'boost',
15-
version: '>=1.66.0',
16-
required: false,
17-
modules: ['graph', 'tuple'],
18-
)
19-
endif
20-
211
py.install_sources(
222
'__init__.py',
233
'all.py',

src/sage/rings/polynomial/pbori/meson.build

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,27 @@ py.install_sources(
3333
extension_data_cpp = {'pbori': files('pbori.pyx')}
3434

3535
foreach name, pyx : extension_data_cpp
36+
override_options = ['cython_language=cpp']
37+
if not boost_cpp17_compatible
38+
override_options += ['cpp_std=c++11']
39+
endif
3640
py.extension_module(
3741
name,
3842
sources: pyx,
3943
subdir: 'sage/rings/polynomial/pbori',
4044
install: true,
41-
override_options: ['cython_language=cpp'],
45+
override_options: override_options,
4246
include_directories: [inc_cpython, inc_ext, inc_rings, inc_src],
43-
dependencies: [py_dep, brial, brial_groebner, cysignals, gmp, m4ri, png],
47+
dependencies: [
48+
py_dep,
49+
boost,
50+
brial,
51+
brial_groebner,
52+
cysignals,
53+
gmp,
54+
m4ri,
55+
png,
56+
],
4457
)
4558
endforeach
4659

0 commit comments

Comments
 (0)