diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index d4525b114..cf84123dc 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]):