diff options
-rw-r--r-- | ci/install-dmd.ps1 | 2 | ||||
-rw-r--r-- | ciimage/Dockerfile | 1 | ||||
-rw-r--r-- | docs/markdown/Dependencies.md | 9 | ||||
-rw-r--r-- | docs/markdown/snippets/gpgme-config.md | 3 | ||||
-rw-r--r-- | mesonbuild/backend/backends.py | 1 | ||||
-rw-r--r-- | mesonbuild/compilers/d.py | 10 | ||||
-rw-r--r-- | mesonbuild/compilers/fortran.py | 35 | ||||
-rw-r--r-- | mesonbuild/dependencies/__init__.py | 3 | ||||
-rw-r--r-- | mesonbuild/dependencies/base.py | 10 | ||||
-rw-r--r-- | mesonbuild/dependencies/misc.py | 31 | ||||
-rw-r--r-- | mesonbuild/modules/python.py | 19 | ||||
-rw-r--r-- | mesonbuild/mtest.py | 19 | ||||
-rw-r--r-- | mesonbuild/scripts/symbolextractor.py | 9 | ||||
-rw-r--r-- | mesonbuild/scripts/vcstagger.py | 8 | ||||
-rwxr-xr-x | run_project_tests.py | 2 | ||||
-rwxr-xr-x | run_unittests.py | 2 | ||||
-rwxr-xr-x | test cases/frameworks/17 mpi/is_broken_ubuntu.py | 9 | ||||
-rw-r--r-- | test cases/frameworks/17 mpi/main.f90 | 51 | ||||
-rw-r--r-- | test cases/frameworks/17 mpi/meson.build | 22 | ||||
-rw-r--r-- | test cases/frameworks/27 gpgme/gpgme_prog.c | 8 | ||||
-rw-r--r-- | test cases/frameworks/27 gpgme/meson.build | 21 | ||||
-rw-r--r-- | test cases/python/1 basic/meson.build | 2 |
22 files changed, 194 insertions, 83 deletions
diff --git a/ci/install-dmd.ps1 b/ci/install-dmd.ps1 index aeacdf2..fd13317 100644 --- a/ci/install-dmd.ps1 +++ b/ci/install-dmd.ps1 @@ -9,8 +9,8 @@ $ProgressPreference = "SilentlyContinue" $dmd_install = "C:\D" $dmd_version_file = "C:\cache\DMD_LATEST" -#echo "Fetching latest DMD version..." if (!$Version) { + #echo "Fetching latest DMD version..." $dmd_latest_url = "http://downloads.dlang.org/releases/LATEST" $retries = 10 for ($i = 1; $i -le $retries; $i++) { diff --git a/ciimage/Dockerfile b/ciimage/Dockerfile index 980ed53..d5f4816 100644 --- a/ciimage/Dockerfile +++ b/ciimage/Dockerfile @@ -20,6 +20,7 @@ RUN sed -i '/^#\sdeb-src /s/^#//' "/etc/apt/sources.list" \ && apt-get -y install --no-install-recommends wine-stable \ && apt-get -y install llvm-dev libclang-dev \ && apt-get -y install libgcrypt11-dev \ +&& apt-get -y install libgpgme-dev \ && apt-get -y install libhdf5-dev \ && dub fetch urld && dub build urld --compiler=gdc \ && dub fetch dubtestproject \ diff --git a/docs/markdown/Dependencies.md b/docs/markdown/Dependencies.md index bd07524..2789ee0 100644 --- a/docs/markdown/Dependencies.md +++ b/docs/markdown/Dependencies.md @@ -200,7 +200,7 @@ wmf_dep = dependency('libwmf', method : 'config-tool') ## Dependencies using config tools [CUPS](#cups), [LLVM](#llvm), [pcap](#pcap), [WxWidgets](#wxwidgets), -[libwmf](#libwmf), [GCrypt](#libgcrypt), and GnuStep either do not provide pkg-config +[libwmf](#libwmf), [GCrypt](#libgcrypt), [GPGME](#gpgme), and GnuStep either do not provide pkg-config modules or additionally can be detected via a config tool (cups-config, llvm-config, libgcrypt-config, etc). Meson has native support for these tools, and they can be found like other dependencies: @@ -210,6 +210,7 @@ pcap_dep = dependency('pcap', version : '>=1.0') cups_dep = dependency('cups', version : '>=1.4') llvm_dep = dependency('llvm', version : '>=4.0') libgcrypt_dep = dependency('libgcrypt', version: '>= 1.8') +gpgme_dep = dependency('gpgme', version: '>= 1.0') ``` ## AppleFrameworks @@ -389,6 +390,12 @@ The `language` keyword may used. `method` may be `auto`, `config-tool` or `pkg-config`. +## GPGME + +*(added 0.51.0)* + +`method` may be `auto` or `config-tool`. + ## Python3 Python3 is handled specially by meson: diff --git a/docs/markdown/snippets/gpgme-config.md b/docs/markdown/snippets/gpgme-config.md new file mode 100644 index 0000000..08a7d38 --- /dev/null +++ b/docs/markdown/snippets/gpgme-config.md @@ -0,0 +1,3 @@ +## gpgme dependency now supports gpgme-config + +Previously, we could only detect GPGME with custom invocations of `gpgme-config`. Now we added support to Meson allowing us to use `dependency('gpgme')` instead. diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index d752ac4..04255dc 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -791,6 +791,7 @@ class Backend: for df in self.interpreter.get_build_def_files()] if self.environment.is_cross_build(): deps.extend(self.environment.coredata.cross_files) + deps.extend(self.environment.coredata.config_files) deps.append('meson-private/coredata.dat') if os.path.exists(os.path.join(self.environment.get_source_dir(), 'meson_options.txt')): deps.append(os.path.join(self.build_to_src, 'meson_options.txt')) diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py index f1580b6..529919b 100644 --- a/mesonbuild/compilers/d.py +++ b/mesonbuild/compilers/d.py @@ -622,7 +622,15 @@ class DmdDCompiler(DCompiler): return [] def get_std_shared_lib_link_args(self): - return ['-shared', '-defaultlib=libphobos2.so'] + libname = 'libphobos2.so' + if is_windows(): + if self.arch == 'x86_64': + libname = 'phobos64.lib' + elif self.arch == 'x86_mscoff': + libname = 'phobos32mscoff.lib' + else: + libname = 'phobos.lib' + return ['-shared', '-defaultlib=' + libname] def get_target_arch_args(self): # DMD32 and DMD64 on 64-bit Windows defaults to 32-bit (OMF). diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index 5afbb3d..e747a35 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -76,18 +76,27 @@ class FortranCompiler(Compiler): def get_soname_args(self, *args): return CCompiler.get_soname_args(self, *args) - def sanity_check(self, work_dir, environment): - source_name = os.path.join(work_dir, 'sanitycheckf.f90') - binary_name = os.path.join(work_dir, 'sanitycheckf') - with open(source_name, 'w') as ofile: - ofile.write('print *, "Fortran compilation is working."; end') + def sanity_check(self, work_dir: Path, environment): + """ + Check to be sure a minimal program can compile and execute + with this compiler & platform. + """ + work_dir = Path(work_dir) + source_name = work_dir / 'sanitycheckf.f90' + binary_name = work_dir / 'sanitycheckf' + if binary_name.is_file(): + binary_name.unlink() + + source_name.write_text('print *, "Fortran compilation is working."; end') + if environment.is_cross_build() and not self.is_cross: for_machine = MachineChoice.BUILD else: for_machine = MachineChoice.HOST extra_flags = environment.coredata.get_external_args(for_machine, self.language) extra_flags += environment.coredata.get_external_link_args(for_machine, self.language) - pc = subprocess.Popen(self.exelist + extra_flags + [source_name, '-o', binary_name]) + # %% build the test executable + pc = subprocess.Popen(self.exelist + extra_flags + [str(source_name), '-o', str(binary_name)]) pc.wait() if pc.returncode != 0: raise EnvironmentException('Compiler %s can not compile programs.' % self.name_string()) @@ -95,12 +104,16 @@ class FortranCompiler(Compiler): if self.exe_wrapper is None: # Can't check if the binaries run so we have to assume they do return - cmdlist = self.exe_wrapper + [binary_name] + cmdlist = self.exe_wrapper + [str(binary_name)] else: - cmdlist = [binary_name] - pe = subprocess.Popen(cmdlist, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) - pe.wait() - if pe.returncode != 0: + cmdlist = [str(binary_name)] + # %% Run the test executable + try: + pe = subprocess.Popen(cmdlist, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + pe.wait() + if pe.returncode != 0: + raise EnvironmentException('Executables created by Fortran compiler %s are not runnable.' % self.name_string()) + except OSError: raise EnvironmentException('Executables created by Fortran compiler %s are not runnable.' % self.name_string()) def get_std_warn_args(self, level): diff --git a/mesonbuild/dependencies/__init__.py b/mesonbuild/dependencies/__init__.py index 1152b8d..846f3de 100644 --- a/mesonbuild/dependencies/__init__.py +++ b/mesonbuild/dependencies/__init__.py @@ -18,7 +18,7 @@ from .base import ( # noqa: F401 ExternalDependency, NotFoundDependency, ExternalLibrary, ExtraFrameworkDependency, InternalDependency, PkgConfigDependency, CMakeDependency, find_external_dependency, get_dep_identifier, packages, _packages_accept_language) from .dev import GMockDependency, GTestDependency, LLVMDependency, ValgrindDependency -from .misc import (CoarrayDependency, HDF5Dependency, MPIDependency, NetCDFDependency, OpenMPDependency, Python3Dependency, ThreadDependency, PcapDependency, CupsDependency, LibWmfDependency, LibGCryptDependency, ShadercDependency) +from .misc import (CoarrayDependency, HDF5Dependency, MPIDependency, NetCDFDependency, OpenMPDependency, Python3Dependency, ThreadDependency, PcapDependency, CupsDependency, LibWmfDependency, LibGCryptDependency, GpgmeDependency, ShadercDependency) from .platform import AppleFrameworks from .ui import GLDependency, GnuStepDependency, Qt4Dependency, Qt5Dependency, SDL2Dependency, WxDependency, VulkanDependency @@ -43,6 +43,7 @@ packages.update({ 'cups': CupsDependency, 'libwmf': LibWmfDependency, 'libgcrypt': LibGCryptDependency, + 'gpgme': GpgmeDependency, 'shaderc': ShadercDependency, # From platform: diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index 1787f1f..f74eabb 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -419,6 +419,14 @@ class ConfigToolDependency(ExternalDependency): best_match = (None, None) for tool in tools: + if len(tool) == 1: + # In some situations the command can't be directly executed. + # For example Shell scripts need to be called through sh on + # Windows (see issue #1423). + potential_bin = ExternalProgram(tool[0], silent=True) + if not potential_bin.found(): + continue + tool = potential_bin.get_command() try: p, out = Popen_safe(tool + ['--version'])[:2] except (FileNotFoundError, PermissionError): @@ -459,7 +467,7 @@ class ConfigToolDependency(ExternalDependency): elif req_version: found_msg.append('need {!r}'.format(req_version)) else: - found_msg += [mlog.green('YES'), '({})'.format(shutil.which(self.config[0])), version] + found_msg += [mlog.green('YES'), '({})'.format(' '.join(self.config)), version] mlog.log(*found_msg) diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 76eccfb..f4694ca 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -212,6 +212,9 @@ class MPIDependency(ExternalDependency): break if not self.is_found and mesonlib.is_windows(): + # only Intel Fortran compiler is compatible with Microsoft MPI at this time. + if language == 'fortran' and environment.detect_fortran_compiler(False).name_string() != 'intel': + return result = self._try_msmpi() if result is not None: self.is_found = True @@ -669,6 +672,34 @@ class LibGCryptDependency(ExternalDependency): return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL] +class GpgmeDependency(ExternalDependency): + def __init__(self, environment, kwargs): + super().__init__('gpgme', environment, None, kwargs) + + @classmethod + def _factory(cls, environment, kwargs): + methods = cls._process_method_kw(kwargs) + candidates = [] + + if DependencyMethods.CONFIG_TOOL in methods: + candidates.append(functools.partial(ConfigToolDependency.factory, + 'gpgme', environment, None, kwargs, ['gpgme-config'], + 'gpgme-config', + GpgmeDependency.tool_finish_init)) + + return candidates + + @staticmethod + def tool_finish_init(ctdep): + ctdep.compile_args = ctdep.get_config_value(['--cflags'], 'compile_args') + ctdep.link_args = ctdep.get_config_value(['--libs'], 'link_args') + ctdep.version = ctdep.get_config_value(['--version'], 'version')[0] + + @staticmethod + def get_methods(): + return [DependencyMethods.CONFIG_TOOL] + + class ShadercDependency(ExternalDependency): def __init__(self, environment, kwargs): diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index 34fe5a5..bd69244 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -131,7 +131,7 @@ class PythonDependency(ExternalDependency): if self.is_found: mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.green('YES ({})'.format(py_lookup_method))) else: - mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.red('NO')) + mlog.log('Dependency', mlog.bold(self.name), 'found:', [mlog.red('NO')]) def _find_libpy(self, python_holder, environment): if python_holder.is_pypy: @@ -498,9 +498,6 @@ class PythonModule(ExtensionModule): def find_installation(self, interpreter, state, args, kwargs): feature_check = FeatureNew('Passing "feature" option to find_installation', '0.48.0') disabled, required, feature = extract_required_kwarg(kwargs, state.subproject, feature_check) - if disabled: - mlog.log('find_installation skipped: feature', mlog.bold(feature), 'disabled') - return ExternalProgramHolder(NonExistingExternalProgram()) if len(args) > 1: raise InvalidArguments('find_installation takes zero or one positional argument.') @@ -511,9 +508,12 @@ class PythonModule(ExtensionModule): if not isinstance(name_or_path, str): raise InvalidArguments('find_installation argument must be a string.') + if disabled: + mlog.log('Program', name_or_path or 'python', 'found:', mlog.red('NO'), '(disabled by:', mlog.bold(feature), ')') + return ExternalProgramHolder(NonExistingExternalProgram()) + if not name_or_path: - mlog.log("Using meson's python {}".format(mesonlib.python_command)) - python = ExternalProgram('python3', mesonlib.python_command, silent=True) + python = ExternalProgram('python3', mesonlib.python_command) else: python = ExternalProgram.from_entry('python3', name_or_path) @@ -521,14 +521,17 @@ class PythonModule(ExtensionModule): pythonpath = self._get_win_pythonpath(name_or_path) if pythonpath is not None: name_or_path = pythonpath - python = ExternalProgram(name_or_path, silent = True) + python = ExternalProgram(name_or_path, silent=True) # Last ditch effort, python2 or python3 can be named python # on various platforms, let's not give up just yet, if an executable # named python is available and has a compatible version, let's use # it if not python.found() and name_or_path in ['python2', 'python3']: - python = ExternalProgram('python', silent = True) + python = ExternalProgram('python', silent=True) + + mlog.log('Program', python.name, 'found:', + *[mlog.green('YES'), '({})'.format(' '.join(python.command))] if python.found() else [mlog.red('NO')]) if not python.found(): if required: diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py index dc82084..0f15690 100644 --- a/mesonbuild/mtest.py +++ b/mesonbuild/mtest.py @@ -490,7 +490,9 @@ class SingleTestRunner: stderr = None if not self.options.verbose: stdout = tempfile.TemporaryFile("wb+") - stderr = tempfile.TemporaryFile("wb+") if self.options and self.options.split else stdout + stderr = tempfile.TemporaryFile("wb+") if self.options.split else stdout + if self.test.protocol == 'tap' and stderr is stdout: + stdout = tempfile.TemporaryFile("wb+") # Let gdb handle ^C instead of us if self.options.gdb: @@ -570,17 +572,16 @@ class SingleTestRunner: endtime = time.time() duration = endtime - starttime if additional_error is None: - if stdout is None: # if stdout is None stderr should be as well + if stdout is None: stdo = '' - stde = '' else: stdout.seek(0) stdo = decode(stdout.read()) - if stderr != stdout: - stderr.seek(0) - stde = decode(stderr.read()) - else: - stde = "" + if stderr is None or stderr is stdout: + stde = '' + else: + stderr.seek(0) + stde = decode(stderr.read()) else: stdo = "" stde = additional_error @@ -590,6 +591,8 @@ class SingleTestRunner: if self.test.protocol == 'exitcode': return TestRun.make_exitcode(self.test, p.returncode, duration, stdo, stde, cmd) else: + if self.options.verbose: + print(stdo, end='') return TestRun.make_tap(self.test, p.returncode, duration, stdo, stde, cmd) diff --git a/mesonbuild/scripts/symbolextractor.py b/mesonbuild/scripts/symbolextractor.py index 976d2f0..95ea0ec 100644 --- a/mesonbuild/scripts/symbolextractor.py +++ b/mesonbuild/scripts/symbolextractor.py @@ -68,7 +68,14 @@ def linux_syms(libfilename, outfilename): libfilename])[0:2] if pnm.returncode != 0: raise RuntimeError('nm does not work.') - result += [' '.join(x.split()[0:2]) for x in output.split('\n') if len(x) > 0] + for line in output.split('\n'): + if len(line) == 0: + continue + line_split = line.split() + entry = line_split[0:2] + if len(line_split) >= 4: + entry += [line_split[3]] + result += [' '.join(entry)] write_if_changed('\n'.join(result) + '\n', outfilename) def osx_syms(libfilename, outfilename): diff --git a/mesonbuild/scripts/vcstagger.py b/mesonbuild/scripts/vcstagger.py index 62a45d9..16dd4d1 100644 --- a/mesonbuild/scripts/vcstagger.py +++ b/mesonbuild/scripts/vcstagger.py @@ -14,6 +14,7 @@ import sys, os, subprocess, re + def config_vcs_tag(infile, outfile, fallback, source_dir, replace_string, regex_selector, cmd): try: output = subprocess.check_output(cmd, cwd=source_dir) @@ -21,17 +22,18 @@ def config_vcs_tag(infile, outfile, fallback, source_dir, replace_string, regex_ except Exception: new_string = fallback - with open(infile) as f: + with open(infile, encoding='utf8') as f: new_data = f.read().replace(replace_string, new_string) if os.path.exists(outfile): - with open(outfile) as f: + with open(outfile, encoding='utf8') as f: needs_update = (f.read() != new_data) else: needs_update = True if needs_update: - with open(outfile, 'w') as f: + with open(outfile, 'w', encoding='utf8') as f: f.write(new_data) + def run(args): infile, outfile, fallback, source_dir, replace_string, regex_selector = args[0:6] command = args[6:] diff --git a/run_project_tests.py b/run_project_tests.py index be6ecd9..fdb5f48 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -563,7 +563,7 @@ def detect_tests_to_run(): ('C#', 'csharp', skip_csharp(backend)), ('vala', 'vala', backend is not Backend.ninja or not shutil.which('valac')), ('rust', 'rust', backend is not Backend.ninja or not shutil.which('rustc')), - ('d', 'd', backend is not Backend.ninja or not have_d_compiler() or mesonlib.is_windows()), + ('d', 'd', backend is not Backend.ninja or not have_d_compiler()), ('objective c', 'objc', backend not in (Backend.ninja, Backend.xcode) or mesonlib.is_windows() or not have_objc_compiler()), ('objective c++', 'objcpp', backend not in (Backend.ninja, Backend.xcode) or mesonlib.is_windows() or not have_objcpp_compiler()), ('fortran', 'fortran', backend is not Backend.ninja or not shutil.which('gfortran')), diff --git a/run_unittests.py b/run_unittests.py index 97e5ef4..19426b8 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -4878,7 +4878,7 @@ endian = 'little' myenv['PKG_CONFIG_PATH'] = self.privatedir stdo = subprocess.check_output(['pkg-config', '--libs-only-l', 'libsomething'], env=myenv) deps = [b'-lgobject-2.0', b'-lgio-2.0', b'-lglib-2.0', b'-lsomething'] - if is_windows() or is_cygwin() or is_osx(): + if is_windows() or is_cygwin() or is_osx() or is_openbsd(): # On Windows, libintl is a separate library deps.append(b'-lintl') self.assertEqual(set(deps), set(stdo.split())) diff --git a/test cases/frameworks/17 mpi/is_broken_ubuntu.py b/test cases/frameworks/17 mpi/is_broken_ubuntu.py deleted file mode 100755 index 27651ba..0000000 --- a/test cases/frameworks/17 mpi/is_broken_ubuntu.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python3 - -# Any exception causes return value to be not zero, which is sufficient. - -import sys - -fc = open('/etc/apt/sources.list').read() -if 'artful' not in fc and 'bionic' not in fc and 'cosmic' not in fc: - sys.exit(1) diff --git a/test cases/frameworks/17 mpi/main.f90 b/test cases/frameworks/17 mpi/main.f90 index d379e96..b5666e8 100644 --- a/test cases/frameworks/17 mpi/main.f90 +++ b/test cases/frameworks/17 mpi/main.f90 @@ -1,21 +1,30 @@ -program mpitest - implicit none - include 'mpif.h' - logical :: flag - integer :: ier - call MPI_Init(ier) - if (ier /= 0) then - print *, 'Unable to initialize MPI: ', ier - stop 1 - endif - call MPI_Initialized(flag, ier) - if (ier /= 0) then - print *, 'Unable to check MPI initialization state: ', ier - stop 1 - endif - call MPI_Finalize(ier) - if (ier /= 0) then - print *, 'Unable to finalize MPI: ', ier - stop 1 - endif -end program mpitest +use, intrinsic :: iso_fortran_env, only: stderr=>error_unit +use mpi + +implicit none + +logical :: flag +integer :: ier + +call MPI_Init(ier) + +if (ier /= 0) then + write(stderr,*) 'Unable to initialize MPI', ier + stop 1 +endif + +call MPI_Initialized(flag, ier) +if (ier /= 0) then + write(stderr,*) 'Unable to check MPI initialization state: ', ier + stop 1 +endif + +call MPI_Finalize(ier) +if (ier /= 0) then + write(stderr,*) 'Unable to finalize MPI: ', ier + stop 1 +endif + +print *, "OK: Fortran MPI" + +end program diff --git a/test cases/frameworks/17 mpi/meson.build b/test cases/frameworks/17 mpi/meson.build index 2d0e4d3..8af9374 100644 --- a/test cases/frameworks/17 mpi/meson.build +++ b/test cases/frameworks/17 mpi/meson.build @@ -26,21 +26,15 @@ if build_machine.system() != 'windows' test('MPI C++', execpp) endif -# OpenMPI is broken with Fortran on Ubuntu Artful. -# Remove this once the following bug has been fixed: -# -# https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1727474 - -ubudetector = find_program('is_broken_ubuntu.py') -uburesult = run_command(ubudetector) - -if uburesult.returncode() != 0 and add_languages('fortran', required : false) - mpifort = dependency('mpi', language : 'fortran') - # Mixing compilers (msvc/clang with gfortran) does not seem to work on Windows. - if build_machine.system() != 'windows' or cc.get_id() == 'gnu' +# One of few feasible ways to use MPI for Fortran on Windows is via Intel compilers. +if build_machine.system() != 'windows' or cc.get_id() == 'intel' + if add_languages('fortran', required : false) + mpifort = dependency('mpi', language : 'fortran') + exef = executable('exef', - 'main.f90', - dependencies : [mpifort]) + 'main.f90', + dependencies : [mpifort]) + test('MPI Fortran', exef) endif endif diff --git a/test cases/frameworks/27 gpgme/gpgme_prog.c b/test cases/frameworks/27 gpgme/gpgme_prog.c new file mode 100644 index 0000000..594f685 --- /dev/null +++ b/test cases/frameworks/27 gpgme/gpgme_prog.c @@ -0,0 +1,8 @@ +#include <gpgme.h> + +int +main() +{ + printf("gpgme-v%s", gpgme_check_version(NULL)); + return 0; +} diff --git a/test cases/frameworks/27 gpgme/meson.build b/test cases/frameworks/27 gpgme/meson.build new file mode 100644 index 0000000..220a4c0 --- /dev/null +++ b/test cases/frameworks/27 gpgme/meson.build @@ -0,0 +1,21 @@ +project('gpgme test', 'c') + +wm = find_program('gpgme-config', required: false) +if not wm.found() + error('MESON_SKIP_TEST: gpgme-config not installed') +endif + +gpgme_dep = dependency('gpgme', version: '>= 1.0') +gpgme_ver = gpgme_dep.version() +assert(gpgme_ver.split('.').length() > 1, 'gpgme version is "@0@"'.format(gpgme_ver)) +message('gpgme version is "@0@"'.format(gpgme_ver)) +e = executable('gpgme_prog', 'gpgme_prog.c', dependencies: gpgme_dep) + +test('gpgmetest', e) + +# Test using the method keyword: + +dependency('gpgme', method: 'config-tool') + +# Check we can apply a version constraint +dependency('gpgme', version: '>=@0@'.format(gpgme_dep.version()), method: 'config-tool') diff --git a/test cases/python/1 basic/meson.build b/test cases/python/1 basic/meson.build index f9a7433..9c3af10 100644 --- a/test cases/python/1 basic/meson.build +++ b/test cases/python/1 basic/meson.build @@ -1,7 +1,7 @@ project('python sample', 'c') py_mod = import('python') -py = py_mod.find_installation() +py = py_mod.find_installation('python3') py_version = py.language_version() if py_version.version_compare('< 3.2') |