boost: Allow older behavior with a warning

Fixes #2813
pull/2819/head
Niklas Claesson 7 years ago
parent a50106afee
commit d014087fd9
  1. 23
      mesonbuild/dependencies/misc.py
  2. 2
      test cases/frameworks/1 boost/meson.build

@ -71,11 +71,6 @@ class BoostDependency(ExternalDependency):
self.is_multithreading = threading == "multi"
self.requested_modules = self.get_requested(kwargs)
invalid_modules = [c for c in self.requested_modules if 'boost_' + c not in BOOST_LIBS]
if invalid_modules:
mlog.warning('Invalid Boost modules: ' + ', '.join(invalid_modules))
self.log_fail()
return
self.boost_root = None
self.boost_roots = []
@ -112,6 +107,24 @@ class BoostDependency(ExternalDependency):
self.log_fail()
return
invalid_modules = [c for c in self.requested_modules if 'boost_' + c not in BOOST_LIBS]
# previous versions of meson allowed include dirs as modules
remove = []
for m in invalid_modules:
if m in os.listdir(os.path.join(self.incdir, 'boost')):
mlog.warning('Requested boost library', mlog.bold(m), 'that doesn\'t exist. '
'This will be an error in the future')
remove.append(m)
self.requested_modules = [x for x in self.requested_modules if x not in remove]
invalid_modules = [x for x in invalid_modules if x not in remove]
if invalid_modules:
mlog.warning('Invalid Boost modules: ' + ', '.join(invalid_modules))
self.log_fail()
return
mlog.debug('Boost library root dir is', mlog.bold(self.boost_root))
mlog.debug('Boost include directory is', mlog.bold(self.incdir))

@ -9,7 +9,7 @@ add_project_arguments(['-DBOOST_LOG_DYN_LINK'],
# within one project. The need to be independent of each other.
# Use one without a library dependency and one with it.
linkdep = dependency('boost', modules : ['thread', 'system'])
linkdep = dependency('boost', modules : ['thread', 'system', 'test'])
staticdep = dependency('boost', modules : ['thread', 'system'], static : true)
testdep = dependency('boost', modules : ['unit_test_framework'])
nomoddep = dependency('boost')

Loading…
Cancel
Save