Explicitly check for OpenMP headers.

pull/1852/head
Elliott Sales de Andrade 7 years ago
parent 9c254cca65
commit 461f3af294
  1. 3
      mesonbuild/compilers/compilers.py
  2. 14
      mesonbuild/dependencies/misc.py

@ -1282,7 +1282,8 @@ class ClangCompiler:
elif version_compare(self.version, '>=3.7.0'):
return ['-fopenmp=libomp']
else:
return None
# Shouldn't work, but it'll be checked explicitly in the OpenMP dependency.
return []
# Tested on linux for ICC 14.0.3, 15.0.6, 16.0.4, 17.0.1

@ -252,10 +252,18 @@ class OpenMPDependency(ExternalDependency):
def __init__(self, environment, kwargs):
language = kwargs.get('language')
super().__init__('openmp', environment, language, kwargs)
self.is_found = True
self.is_found = False
openmp_date = self.compiler.get_define('_OPENMP', '', self.env, [], [self])
self.version = self.VERSIONS[openmp_date]
mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.green('YES'), self.version)
if openmp_date:
self.version = self.VERSIONS[openmp_date]
if self.compiler.has_header('omp.h', '', self.env, dependencies=[self]):
self.is_found = True
else:
mlog.log(mlog.yellow('WARNING:'), 'OpenMP found but omp.h missing.')
if self.is_found:
mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.green('YES'), self.version)
else:
mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.red('NO'))
def need_openmp(self):
return True

Loading…
Cancel
Save