Skip to content

Commit abdfd0f

Browse files
committed
meson: make several optional features explicitly configurable
Several libraries are detected at setup time, and the corresponding feature is enabled or disabled based on the library's presence. This commit retains this behavior by default while making it possible to explicitly enable or disable the feature via, $ meson setup -Dfoo=disabled or $ meson setup -Dfoo=enabled The former disables the feature even if the library is installed, and the latter makes it an error if the library is not installed. The list of features (valid values for foo) is, * bliss * brial * coxeter3 * mcqd * meataxe * rankwidth * sirocco * tdlib
1 parent aca4aed commit abdfd0f

File tree

7 files changed

+73
-15
lines changed

7 files changed

+73
-15
lines changed

meson.options

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,62 @@ option(
1616
type: 'boolean',
1717
description: 'Build the HTML / PDF documentation'
1818
)
19+
20+
#
21+
# Features
22+
#
23+
option(
24+
'bliss',
25+
type: 'feature',
26+
value: 'auto',
27+
description: 'Bliss interface to graph isomorphisms'
28+
)
29+
30+
option(
31+
'brial',
32+
type: 'feature',
33+
value: 'auto',
34+
description: 'BRiAl interface to polynomials over boolean rings'
35+
)
36+
37+
option(
38+
'coxeter3',
39+
type: 'feature',
40+
value: 'auto',
41+
description: 'Coxeter 3.x interface to Coxeter groups'
42+
)
43+
44+
option(
45+
'mcqd',
46+
type: 'feature',
47+
value: 'auto',
48+
description: 'MCQD interface to the MaxCliqueDyn algorithm'
49+
)
50+
51+
option(
52+
'meataxe',
53+
type: 'feature',
54+
value: 'auto',
55+
description: 'Interface to the MeatAxe program'
56+
)
57+
58+
option(
59+
'rankwidth',
60+
type: 'feature',
61+
value: 'auto',
62+
description: 'Interface to librw for rank-width decompositions'
63+
)
64+
65+
option(
66+
'sirocco',
67+
type: 'feature',
68+
value: 'auto',
69+
description: 'Sirocco interface to certified root continuation'
70+
)
71+
72+
option(
73+
'tdlib',
74+
type: 'feature',
75+
value: 'auto',
76+
description: 'Interface to tdlib for tree decompositions'
77+
)

src/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ endif
151151
# Cannot be found via pkg-config
152152
mtx = cc.find_library(
153153
'mtx',
154-
required: false,
154+
required: get_option('meataxe'),
155155
disabler: true,
156156
has_headers: ['meataxe.h'],
157157
)

src/sage/graphs/graph_decompositions/meson.build

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
# tdlib is a header-only library
2-
if cc.has_header('treedec/combinations.hpp')
1+
tdlib = disabler()
2+
if cc.has_header('treedec/combinations.hpp', required: get_option('tdlib'))
3+
# tdlib is a header-only library
34
tdlib = declare_dependency()
4-
else
5-
tdlib = disabler()
65
endif
76
# Cannot be found via pkg-config
8-
rw = cc.find_library('rw', required: false, disabler: true)
7+
rw = cc.find_library('rw', required: get_option('rankwidth'), disabler: true)
98

109
py.install_sources(
1110
'__init__.py',

src/sage/graphs/meson.build

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
bliss = cc.find_library('bliss', required: false, disabler: true)
2-
# mcqd is a header-only library
3-
if cc.has_header('mcqd.h')
1+
bliss = cc.find_library('bliss', required: get_option('bliss'), disabler: true)
2+
3+
mcqd = disabler()
4+
if cc.has_header('mcqd.h', required: get_option('mcqd'))
5+
# mcqd is a header-only library
46
mcqd = declare_dependency()
5-
else
6-
mcqd = disabler()
77
endif
88
cliquer = cc.find_library('cliquer', required: not is_windows, disabler: true)
99

src/sage/libs/coxeter3/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
coxeter3 = cc.find_library('coxeter3', required: false, disabler: true)
1+
coxeter3 = cc.find_library('coxeter3', required: get_option('coxeter3'), disabler: true)
22
py.install_sources(
33
'__init__.py',
44
'all__sagemath_coxeter3.py',

src/sage/libs/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sirocco = cc.find_library('sirocco', required: false, disabler: true)
1+
sirocco = cc.find_library('sirocco', required: get_option('sirocco'), disabler: true)
22
# cannot be found via pkg-config
33
ecl = cc.find_library('ecl', required: false, disabler: true)
44
if not ecl.found() and not is_windows

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
brial = cc.find_library('brial', required: false, disabler: true)
1+
brial = cc.find_library('brial', required: get_option('brial'), disabler: true)
22
# Cannot be found via pkg-config
33
brial_groebner = cc.find_library(
44
'brial_groebner',
5-
required: false,
5+
required: get_option('brial'),
66
disabler: true,
77
)
88

0 commit comments

Comments
 (0)