aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-07-29 01:27:26 -0400
committerMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-07-29 01:27:26 -0400
commitdfa52469d7dac6fbed285e90dbbd1b491cb5a471 (patch)
tree1cb100d208231e48e9a28b4e330c81ab527b7461 /mesonbuild
parentbc08ace84ee5006639558c7bba93e2d675ed472f (diff)
downloadmeson-dfa52469d7dac6fbed285e90dbbd1b491cb5a471.zip
meson-dfa52469d7dac6fbed285e90dbbd1b491cb5a471.tar.gz
meson-dfa52469d7dac6fbed285e90dbbd1b491cb5a471.tar.bz2
openmp: allow omp.h or omp_lib.h
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/dependencies/misc.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py
index 1bb1b6e..c463ec3 100644
--- a/mesonbuild/dependencies/misc.py
+++ b/mesonbuild/dependencies/misc.py
@@ -380,11 +380,14 @@ class OpenMPDependency(ExternalDependency):
if openmp_date:
self.version = self.VERSIONS[openmp_date]
- if self.clib_compiler.has_header('omp.h', '', self.env, dependencies=[self], disable_cache=True)[0]:
- self.is_found = True
- self.compile_args = self.link_args = self.clib_compiler.openmp_flags()
- else:
- mlog.log(mlog.yellow('WARNING:'), 'OpenMP found but omp.h missing.')
+ # Flang has omp_lib.h
+ header_names = ('omp.h', 'omp_lib.h')
+ for name in header_names:
+ if self.clib_compiler.has_header(name, '', self.env, dependencies=[self], disable_cache=True)[0]:
+ self.is_found = True
+ self.compile_args = self.link_args = self.clib_compiler.openmp_flags()
+ else:
+ mlog.log(mlog.yellow('WARNING:'), 'OpenMP found but omp.h missing.')
class ThreadDependency(ExternalDependency):