aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/dependencies/misc.py23
-rw-r--r--test cases/failing/69 wrong boost module/meson.build5
-rw-r--r--test cases/frameworks/1 boost/meson.build2
3 files changed, 24 insertions, 6 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py
index 6ffa42a..7ceda3e 100644
--- a/mesonbuild/dependencies/misc.py
+++ b/mesonbuild/dependencies/misc.py
@@ -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))
diff --git a/test cases/failing/69 wrong boost module/meson.build b/test cases/failing/69 wrong boost module/meson.build
new file mode 100644
index 0000000..7fb3a40
--- /dev/null
+++ b/test cases/failing/69 wrong boost module/meson.build
@@ -0,0 +1,5 @@
+project('boosttest', 'cpp',
+ default_options : ['cpp_std=c++11'])
+
+# abc doesn't exist
+linkdep = dependency('boost', modules : ['thread', 'system', 'test', 'abc'])
diff --git a/test cases/frameworks/1 boost/meson.build b/test cases/frameworks/1 boost/meson.build
index b73f93a..771ecbc 100644
--- a/test cases/frameworks/1 boost/meson.build
+++ b/test cases/frameworks/1 boost/meson.build
@@ -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')