From 8636f31d9c6f44a19cca0622b5478fa6202c1334 Mon Sep 17 00:00:00 2001 From: "Michael Hirsch, Ph.D" Date: Sun, 27 Jan 2019 13:57:21 -0500 Subject: BUGFIX: broken/missing Fortran code/unit tests --- mesonbuild/compilers/c.py | 5 +++-- mesonbuild/compilers/compilers.py | 2 +- mesonbuild/compilers/fortran.py | 13 +++++++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) (limited to 'mesonbuild/compilers') diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index a8be2b0..c0cd0bc 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -19,6 +19,7 @@ import subprocess import functools import itertools from pathlib import Path +from typing import List from .. import mlog from .. import coredata @@ -456,7 +457,7 @@ class CCompiler(Compiler): return self.compiles(code, env, extra_args=extra_args, dependencies=dependencies, mode='link') - def run(self, code, env, *, extra_args=None, dependencies=None): + def run(self, code: str, env, *, extra_args=None, dependencies=None): if self.is_cross and self.exe_wrapper is None: raise CrossNoRunException('Can not run test applications in this cross environment.') with self._build_wrapper(code, env, extra_args, dependencies, mode='link', want_output=True) as p: @@ -978,7 +979,7 @@ class CCompiler(Compiler): return [f.as_posix()] @staticmethod - def _get_file_from_list(files): + def _get_file_from_list(files: List[str]) -> str: for f in files: if os.path.isfile(f): return f diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index b1f3cc2..97e2b94 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -1795,7 +1795,7 @@ class ArmclangCompiler: EnvironmentException('armlink version string not found') # Using the regular expression from environment.search_version, # which is used for searching compiler version - version_regex = '(? List[str]: + return CCompiler._get_file_from_list(files) class GnuFortranCompiler(GnuCompiler, FortranCompiler): def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, defines=None, **kwargs): -- cgit v1.1