diff options
author | Benjamin Redelings <benjamin.redelings@gmail.com> | 2018-01-22 22:20:46 -0500 |
---|---|---|
committer | Benjamin Redelings <benjamin.redelings@gmail.com> | 2018-01-22 22:31:01 -0500 |
commit | 9759294a7f81979ee1bf70d5311bbfa7cc77b7d9 (patch) | |
tree | 7435896cdd3921d7b65c3bb378a4cc9309964b44 | |
parent | 2757d7fd127c9ab7cf81205634fb64615782e818 (diff) | |
download | meson-9759294a7f81979ee1bf70d5311bbfa7cc77b7d9.zip meson-9759294a7f81979ee1bf70d5311bbfa7cc77b7d9.tar.gz meson-9759294a7f81979ee1bf70d5311bbfa7cc77b7d9.tar.bz2 |
Factor check for invalid BOOST modules into separate function.
-rw-r--r-- | mesonbuild/dependencies/misc.py | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 2ea8ed1..64b2072 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -147,22 +147,7 @@ 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 BOOST_DIRS: - 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.log(mlog.red('ERROR:'), 'Invalid Boost modules: ' + ', '.join(invalid_modules)) - self.log_fail() + if self.check_invalid_modules(): return mlog.debug('Boost library root dir is', mlog.bold(self.boost_root)) @@ -183,6 +168,26 @@ class BoostDependency(ExternalDependency): else: self.log_fail() + def check_invalid_modules(self): + 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 BOOST_DIRS: + 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.log(mlog.red('ERROR:'), 'Invalid Boost modules: ' + ', '.join(invalid_modules)) + self.log_fail() + return True + else: + return False def log_fail(self): module_str = ', '.join(self.requested_modules) |