Merge pull request #2781 from dcbaker/submit/config-tool-correct-name

Small cosmetic cleanups for ConfigTool dependencies and LLVM
pull/2270/merge
Jussi Pakkanen 7 years ago committed by GitHub
commit 83fb76c9ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      mesonbuild/dependencies/base.py
  2. 6
      mesonbuild/dependencies/dev.py
  3. 2
      run_unittests.py

@ -284,17 +284,18 @@ class ConfigToolDependency(ExternalDependency):
"""Helper method to print messages about the tool.""" """Helper method to print messages about the tool."""
if self.config is None: if self.config is None:
if version is not None: if version is not None:
mlog.log('found {} {!r} but need:'.format(self.tool_name, version), mlog.log('Found', mlog.bold(self.tool_name), repr(version),
req_version) mlog.red('NO'), '(needed', req_version, ')')
else: else:
mlog.log("No {} found; can't detect dependency".format(self.tool_name)) mlog.log('Found', mlog.bold(self.tool_name), repr(req_version),
mlog.log('Dependency {} found:'.format(self.name), mlog.red('NO')) mlog.red('NO'))
mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.red('NO'))
if self.required: if self.required:
raise DependencyException('Dependency {} not found'.format(self.name)) raise DependencyException('Dependency {} not found'.format(self.name))
return False return False
mlog.log('Found {}:'.format(self.tool_name), mlog.bold(shutil.which(self.config)), mlog.log('Found {}:'.format(self.tool_name), mlog.bold(shutil.which(self.config)),
'({})'.format(version)) '({})'.format(version))
mlog.log('Dependency {} found:'.format(self.name), mlog.green('YES')) mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.green('YES'))
return True return True
def get_config_value(self, args, stage): def get_config_value(self, args, stage):

@ -140,7 +140,7 @@ class LLVMDependency(ConfigToolDependency):
def __init__(self, environment, kwargs): def __init__(self, environment, kwargs):
# It's necessary for LLVM <= 3.8 to use the C++ linker. For 3.9 and 4.0 # It's necessary for LLVM <= 3.8 to use the C++ linker. For 3.9 and 4.0
# the C linker works fine if only using the C API. # the C linker works fine if only using the C API.
super().__init__('config-tool', environment, 'cpp', kwargs) super().__init__('LLVM', environment, 'cpp', kwargs)
self.provided_modules = [] self.provided_modules = []
self.required_modules = set() self.required_modules = set()
if not self.is_found: if not self.is_found:
@ -213,7 +213,7 @@ class LLVMDependency(ConfigToolDependency):
""" """
for mod in sorted(set(modules)): for mod in sorted(set(modules)):
if mod not in self.provided_modules: if mod not in self.provided_modules:
mlog.log('LLVM module', mod, 'found:', mlog.red('NO'), mlog.log('LLVM module', mlog.bold(mod), 'found:', mlog.red('NO'),
'(optional)' if not required else '') '(optional)' if not required else '')
if required: if required:
self.is_found = False self.is_found = False
@ -222,7 +222,7 @@ class LLVMDependency(ConfigToolDependency):
'Could not find required LLVM Component: {}'.format(mod)) 'Could not find required LLVM Component: {}'.format(mod))
else: else:
self.required_modules.add(mod) self.required_modules.add(mod)
mlog.log('LLVM module', mod, 'found:', mlog.green('YES')) mlog.log('LLVM module', mlog.bold(mod), 'found:', mlog.green('YES'))
def need_threads(self): def need_threads(self):
return True return True

@ -1741,7 +1741,7 @@ class FailureTests(BasePlatformTests):
raise unittest.SkipTest('wx-config or wx-config-3.0 found') raise unittest.SkipTest('wx-config or wx-config-3.0 found')
self.assertMesonRaises("dependency('wxwidgets')", self.dnf) self.assertMesonRaises("dependency('wxwidgets')", self.dnf)
self.assertMesonOutputs("dependency('wxwidgets', required : false)", self.assertMesonOutputs("dependency('wxwidgets', required : false)",
"No wx-config found;") "Dependency .*WxWidgets.* found: .*NO.*")
def test_wx_dependency(self): def test_wx_dependency(self):
if not shutil.which('wx-config-3.0') and not shutil.which('wx-config'): if not shutil.which('wx-config-3.0') and not shutil.which('wx-config'):

Loading…
Cancel
Save