diff options
author | David Seifert <soap@gentoo.org> | 2018-05-01 14:21:02 +0200 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-05-02 11:44:53 +0000 |
commit | d28e6c6153043617a9bccf603d42f4a0d41a11aa (patch) | |
tree | 2320691b39b95122fb69cd7571cd98eb05037eab /mesonbuild | |
parent | b730ab6766e072ca4cc9cc44231a7cc17a7bc299 (diff) | |
download | meson-d28e6c6153043617a9bccf603d42f4a0d41a11aa.zip meson-d28e6c6153043617a9bccf603d42f4a0d41a11aa.tar.gz meson-d28e6c6153043617a9bccf603d42f4a0d41a11aa.tar.bz2 |
Allow `required : false` for OpenMP dependency
* Currently `required : true` is implicitly assumed, making
optional use of OpenMP not possible.
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/dependencies/misc.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index d4525b1..cf84123 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -253,7 +253,13 @@ class OpenMPDependency(ExternalDependency): language = kwargs.get('language') super().__init__('openmp', environment, language, kwargs) self.is_found = False - openmp_date = self.compiler.get_define('_OPENMP', '', self.env, [], [self]) + try: + openmp_date = self.compiler.get_define('_OPENMP', '', self.env, [], [self]) + except mesonlib.EnvironmentException as e: + mlog.debug('OpenMP support not available in the compiler') + mlog.debug(e) + openmp_date = False + if openmp_date: self.version = self.VERSIONS[openmp_date] if self.compiler.has_header('omp.h', '', self.env, dependencies=[self]): |