aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-04-07 00:52:03 -0400
committerMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-04-27 23:19:01 -0400
commitee40533b61ba9694e783e3333362e91fff964171 (patch)
tree2903353b6169c0507a3a98864d426637c83d5b24 /mesonbuild/environment.py
parent25fa5d090fab2522082280ea36484bd4ac9e9aa2 (diff)
downloadmeson-ee40533b61ba9694e783e3333362e91fff964171.zip
meson-ee40533b61ba9694e783e3333362e91fff964171.tar.gz
meson-ee40533b61ba9694e783e3333362e91fff964171.tar.bz2
better default order for fotran compiler search
correct PGI windows detection doc cleanup PGI detect
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 57fe4e5..e0cb998 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -13,6 +13,7 @@
# limitations under the License.
import os, platform, re, sys, shlex, shutil, subprocess
+from typing import List
from . import coredata
from .linkers import ArLinker, ArmarLinker, VisualStudioLinker, DLinker, CcrxLinker
@@ -769,9 +770,16 @@ class Environment:
target = 'x86'
cls = VisualStudioCCompiler if lang == 'c' else VisualStudioCPPCompiler
return cls(compiler, version, is_cross, exe_wrap, target)
+
if 'PGI Compilers' in out:
+ if mesonlib.for_darwin(want_cross, self):
+ compiler_type = CompilerType.PGI_OSX
+ elif mesonlib.for_windows(want_cross, self):
+ compiler_type = CompilerType.PGI_WIN
+ else:
+ compiler_type = CompilerType.PGI_STANDARD
cls = PGICCompiler if lang == 'c' else PGICPPCompiler
- return cls(ccache + compiler, version, is_cross, exe_wrap)
+ return cls(ccache + compiler, version, compiler_type, is_cross, exe_wrap)
if '(ICC)' in out:
if mesonlib.for_darwin(want_cross, self):
compiler_type = CompilerType.ICC_OSX
@@ -883,7 +891,13 @@ class Environment:
return PathScaleFortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version)
if 'PGI Compilers' in out:
- return PGIFortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version)
+ if mesonlib.for_darwin(want_cross, self):
+ compiler_type = CompilerType.PGI_OSX
+ elif mesonlib.for_windows(want_cross, self):
+ compiler_type = CompilerType.PGI_WIN
+ else:
+ compiler_type = CompilerType.PGI_STANDARD
+ return PGIFortranCompiler(compiler, version, compiler_type, is_cross, exe_wrap, full_version=full_version)
if 'flang' in out or 'clang' in out:
return FlangFortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version)
@@ -1039,7 +1053,8 @@ class Environment:
# up to date language version at time (2016).
if exelist is not None:
if os.path.basename(exelist[-1]).startswith(('ldmd', 'gdmd')):
- raise EnvironmentException('Meson doesn\'t support %s as it\'s only a DMD frontend for another compiler. Please provide a valid value for DC or unset it so that Meson can resolve the compiler by itself.' % exelist[-1])
+ raise EnvironmentException('Meson does not support {} as it is only a DMD frontend for another compiler.'.format(exelist[-1])
+ 'Please provide a valid value for DC or unset it so that Meson can resolve the compiler by itself.')
else:
for d in self.default_d:
if shutil.which(d):