diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-12-04 13:32:31 +0000 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-12-05 19:39:44 +0200 |
commit | a2b0dd13a4103153ab4bd0e60447f7e90a87df03 (patch) | |
tree | c96afaf749a7e389ca8751a592e43326e2da9fa8 | |
parent | 0b3a607fd8629493f0cab499a6f3e873d7d09773 (diff) | |
download | meson-a2b0dd13a4103153ab4bd0e60447f7e90a87df03.zip meson-a2b0dd13a4103153ab4bd0e60447f7e90a87df03.tar.gz meson-a2b0dd13a4103153ab4bd0e60447f7e90a87df03.tar.bz2 |
Don't blame absent cmake for all missing dependencies
-rw-r--r-- | mesonbuild/dependencies/base.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index 9855b20..cd02939 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -2019,7 +2019,7 @@ def find_external_dependency(name, env, kwargs): # build a list of dependency methods to try candidates = _build_external_dependency_list(name, env, kwargs) - pkg_exc = None + pkg_exc = [] pkgdep = [] details = '' @@ -2030,11 +2030,10 @@ def find_external_dependency(name, env, kwargs): d._check_version() pkgdep.append(d) except Exception as e: + pkg_exc.append(e) mlog.debug(str(e)) - # store the first exception we see - if not pkg_exc: - pkg_exc = e else: + pkg_exc.append(None) details = d.log_details() if details: details = '(' + details + ') ' @@ -2069,10 +2068,11 @@ def find_external_dependency(name, env, kwargs): '(tried {})'.format(tried) if tried else '') if required: - # if exception(s) occurred, re-raise the first one (on the grounds that - # it came from a preferred dependency detection method) - if pkg_exc: - raise pkg_exc + # if an exception occurred with the first detection method, re-raise it + # (on the grounds that it came from the preferred dependency detection + # method) + if pkg_exc[0]: + raise pkg_exc[0] # we have a list of failed ExternalDependency objects, so we can report # the methods we tried to find the dependency |