Skip to content

Commit f88acc0

Browse files
committed
build: add cld2 option
Add an option for builders to explicitly disable cld2, instead of relying on the automatic detection.
1 parent 9d7f3f1 commit f88acc0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

meson.build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,11 @@ else
189189
endif
190190

191191
# optionally, use Compact Language Detector2 if we can find it.
192-
cld2_dep = meson.get_compiler('cpp').find_library('cld2', required: false)
193-
if cld2_dep.found()
192+
cld2_dep = meson.get_compiler('cpp').find_library('cld2', required: get_option('cld2'))
193+
if not get_option('cld2').disabled() and cld2_dep.found()
194194
config_h_data.set('HAVE_CLD2', 1)
195195
else
196-
message('CLD2 not found; no support for language detection')
196+
message('CLD2 not found or disabled; no support for language detection')
197197
endif
198198

199199
# note: these are for the unit-tests

meson_options.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ option('guile',
2424
value: 'auto',
2525
description: 'build the guile scripting support (requires guile-3.x)')
2626

27+
option('cld2',
28+
type : 'feature',
29+
value: 'auto',
30+
description: 'Compact Language Detector2')
31+
2732
# by default, this uses guile_dep.get_variable(pkgconfig: 'extensiondir')
2833
option('guile-extension-dir',
2934
type: 'string',

0 commit comments

Comments
 (0)