diff options
-rw-r--r-- | mesonbuild/cmake/interpreter.py | 3 | ||||
-rw-r--r-- | mesonbuild/compilers/__init__.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/compilers.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/arm.py | 1 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/ccrx.py | 2 | ||||
-rw-r--r-- | mesonbuild/envconfig.py | 2 | ||||
-rw-r--r-- | mesonbuild/scripts/scanbuild.py | 1 | ||||
-rwxr-xr-x | run_tests.py | 1 | ||||
-rwxr-xr-x | run_unittests.py | 5 | ||||
-rw-r--r-- | test cases/cmake/13 system includes/main.cpp | 10 | ||||
-rw-r--r-- | test cases/cmake/13 system includes/meson.build | 14 | ||||
-rw-r--r-- | test cases/cmake/13 system includes/subprojects/cmMod/CMakeLists.txt | 15 | ||||
-rw-r--r-- | test cases/cmake/13 system includes/subprojects/cmMod/cmMod.cpp | 12 | ||||
-rw-r--r-- | test cases/cmake/13 system includes/subprojects/cmMod/cmMod.hpp | 13 | ||||
-rw-r--r-- | test cases/cmake/13 system includes/subprojects/cmMod/sysInc/triggerWarn.hpp | 14 | ||||
-rw-r--r-- | test cases/python/4 custom target depends extmodule/meson.build | 5 | ||||
-rw-r--r-- | test cases/python3/2 extmodule/meson.build | 9 | ||||
-rw-r--r-- | test cases/python3/4 custom target depends extmodule/meson.build | 6 |
18 files changed, 108 insertions, 9 deletions
diff --git a/mesonbuild/cmake/interpreter.py b/mesonbuild/cmake/interpreter.py index 8ac173f..1c672be 100644 --- a/mesonbuild/cmake/interpreter.py +++ b/mesonbuild/cmake/interpreter.py @@ -84,7 +84,8 @@ target_type_requires_trace = ['INTERFACE_LIBRARY'] skip_targets = ['UTILITY'] blacklist_compiler_flags = [ - '/W1', '/W2', '/W3', '/W4', '/Wall', + '-Wall', '-Wextra', '-Weverything', '-Werror', '-Wpedantic', '-pedantic', '-w', + '/W1', '/W2', '/W3', '/W4', '/Wall', '/WX', '/w', '/O1', '/O2', '/Ob', '/Od', '/Og', '/Oi', '/Os', '/Ot', '/Ox', '/Oy', '/Ob0', '/RTC1', '/RTCc', '/RTCs', '/RTCu', '/Z7', '/Zi', '/ZI', diff --git a/mesonbuild/compilers/__init__.py b/mesonbuild/compilers/__init__.py index aebfb32..b378a63 100644 --- a/mesonbuild/compilers/__init__.py +++ b/mesonbuild/compilers/__init__.py @@ -55,9 +55,11 @@ __all__ = [ 'G95FortranCompiler', 'GnuCCompiler', 'ElbrusCCompiler', + 'EmscriptenCCompiler', 'GnuCompiler', 'GnuCPPCompiler', 'ElbrusCPPCompiler', + 'EmscriptenCPPCompiler', 'GnuDCompiler', 'GnuFortranCompiler', 'ElbrusFortranCompiler', diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 8456a99..51ff55d 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -21,7 +21,7 @@ from .. import coredata from .. import mlog from .. import mesonlib from ..mesonlib import ( - EnvironmentException, MachineChoice, MesonException, OrderedSet, + EnvironmentException, MachineChoice, MesonException, Popen_safe, split_args ) from ..envconfig import ( diff --git a/mesonbuild/compilers/mixins/arm.py b/mesonbuild/compilers/mixins/arm.py index 62e6f48..3a7e597 100644 --- a/mesonbuild/compilers/mixins/arm.py +++ b/mesonbuild/compilers/mixins/arm.py @@ -76,7 +76,6 @@ class ArmCompiler: # Assembly self.can_compile_suffixes.add('s') - def get_pic_args(self) -> typing.List[str]: # FIXME: Add /ropi, /rwpi, /fpic etc. qualifiers to --apcs return [] diff --git a/mesonbuild/compilers/mixins/ccrx.py b/mesonbuild/compilers/mixins/ccrx.py index 7fbc316..c6979a4 100644 --- a/mesonbuild/compilers/mixins/ccrx.py +++ b/mesonbuild/compilers/mixins/ccrx.py @@ -17,7 +17,7 @@ import os import typing -from ...mesonlib import Popen_safe, EnvironmentException +from ...mesonlib import EnvironmentException if typing.TYPE_CHECKING: from ...environment import Environment diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py index de8ee16..716ee91 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py @@ -260,11 +260,9 @@ class MachineInfo: """Machine is illumos or Solaris?""" return self.system == 'sunos' - # Various prefixes and suffixes for import libraries, shared libraries, # static libraries, and executables. # Versioning is added to these names in the backends as-needed. - def get_exe_suffix(self) -> str: if self.is_windows() or self.is_cygwin(): return 'exe' diff --git a/mesonbuild/scripts/scanbuild.py b/mesonbuild/scripts/scanbuild.py index d83ca12..b9e96d2 100644 --- a/mesonbuild/scripts/scanbuild.py +++ b/mesonbuild/scripts/scanbuild.py @@ -17,7 +17,6 @@ import subprocess import shutil import tempfile from ..environment import detect_ninja, detect_scanbuild -from ..mesonlib import Popen_safe, split_args def scanbuild(exelist, srcdir, blddir, privdir, logdir, args): diff --git a/run_tests.py b/run_tests.py index 85a55c3..504e6ac 100755 --- a/run_tests.py +++ b/run_tests.py @@ -116,7 +116,6 @@ def get_fake_env(sdir='', bdir=None, prefix='', opts=None): Backend = Enum('Backend', 'ninja vs xcode') if 'MESON_EXE' in os.environ: - import shlex meson_exe = mesonlib.split_args(os.environ['MESON_EXE']) else: meson_exe = None diff --git a/run_unittests.py b/run_unittests.py index 4da3a8f..f587429 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -2497,6 +2497,8 @@ class AllPlatformTests(BasePlatformTests): def test_dist_git(self): if not shutil.which('git'): raise unittest.SkipTest('Git not found') + if self.backend is not Backend.ninja: + raise unittest.SkipTest('Dist is only supported with Ninja') try: self.dist_impl(_git_init) @@ -2531,6 +2533,8 @@ class AllPlatformTests(BasePlatformTests): def test_dist_git_script(self): if not shutil.which('git'): raise unittest.SkipTest('Git not found') + if self.backend is not Backend.ninja: + raise unittest.SkipTest('Dist is only supported with Ninja') try: with tempfile.TemporaryDirectory() as tmpdir: @@ -3179,7 +3183,6 @@ recommended as it is not supported on some platforms''') self.installdir = initial_builddir self.builddir = initial_installdir - def test_conflicting_d_dash_option(self): testdir = os.path.join(self.unit_test_dir, '37 mixed command line args') with self.assertRaises(subprocess.CalledProcessError) as e: diff --git a/test cases/cmake/13 system includes/main.cpp b/test cases/cmake/13 system includes/main.cpp new file mode 100644 index 0000000..315c0f7 --- /dev/null +++ b/test cases/cmake/13 system includes/main.cpp @@ -0,0 +1,10 @@ +#include <iostream> +#include <cmMod.hpp> + +using namespace std; + +int main() { + cmModClass obj("Hello"); + cout << obj.getStr() << endl; + return 0; +} diff --git a/test cases/cmake/13 system includes/meson.build b/test cases/cmake/13 system includes/meson.build new file mode 100644 index 0000000..db25a42 --- /dev/null +++ b/test cases/cmake/13 system includes/meson.build @@ -0,0 +1,14 @@ +project( + 'meson_cmake_system_include_bug', ['c', 'cpp'], + default_options: [ + 'warning_level=3', + #'werror=true', # TODO implement system includes + ], +) + +cm = import('cmake') +sub_pro = cm.subproject('cmMod') +sub_dep = sub_pro.dependency('cmModLib') + +exe1 = executable('main1', ['main.cpp'], dependencies: [sub_dep]) +test('test1', exe1) diff --git a/test cases/cmake/13 system includes/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/13 system includes/subprojects/cmMod/CMakeLists.txt new file mode 100644 index 0000000..a6b0ba4 --- /dev/null +++ b/test cases/cmake/13 system includes/subprojects/cmMod/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.5) + +project(cmMod) +set (CMAKE_CXX_STANDARD 14) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +add_definitions("-DDO_NOTHING_JUST_A_FLAG=1") + +add_library(cmModLib SHARED cmMod.cpp) +include(GenerateExportHeader) +generate_export_header(cmModLib) + +target_compile_options(cmModLib PRIVATE "-Wall" "-Werror") +target_include_directories(cmModLib SYSTEM PRIVATE "sysInc") diff --git a/test cases/cmake/13 system includes/subprojects/cmMod/cmMod.cpp b/test cases/cmake/13 system includes/subprojects/cmMod/cmMod.cpp new file mode 100644 index 0000000..1eaf0cf --- /dev/null +++ b/test cases/cmake/13 system includes/subprojects/cmMod/cmMod.cpp @@ -0,0 +1,12 @@ +#include "cmMod.hpp" +#include "triggerWarn.hpp" + +using namespace std; + +cmModClass::cmModClass(string foo) { + str = foo + " World " + to_string(bar(World)); +} + +string cmModClass::getStr() const { + return str; +} diff --git a/test cases/cmake/13 system includes/subprojects/cmMod/cmMod.hpp b/test cases/cmake/13 system includes/subprojects/cmMod/cmMod.hpp new file mode 100644 index 0000000..52f576b --- /dev/null +++ b/test cases/cmake/13 system includes/subprojects/cmMod/cmMod.hpp @@ -0,0 +1,13 @@ +#pragma once + +#include <string> +#include "cmmodlib_export.h" + +class CMMODLIB_EXPORT cmModClass { + private: + std::string str; + public: + cmModClass(std::string foo); + + std::string getStr() const; +}; diff --git a/test cases/cmake/13 system includes/subprojects/cmMod/sysInc/triggerWarn.hpp b/test cases/cmake/13 system includes/subprojects/cmMod/sysInc/triggerWarn.hpp new file mode 100644 index 0000000..3b00f2d --- /dev/null +++ b/test cases/cmake/13 system includes/subprojects/cmMod/sysInc/triggerWarn.hpp @@ -0,0 +1,14 @@ +#pragma once + +enum Foo { + Hello, + World +}; + +inline int bar( Foo foo ) { + switch(foo) { + case Hello: return 0; + // Warn because of missung case for World + } + return 1; +} diff --git a/test cases/python/4 custom target depends extmodule/meson.build b/test cases/python/4 custom target depends extmodule/meson.build index 4e2aff0..3835377 100644 --- a/test cases/python/4 custom target depends extmodule/meson.build +++ b/test cases/python/4 custom target depends extmodule/meson.build @@ -6,6 +6,7 @@ project('Python extension module', 'c', py_mod = import('python') py3 = py_mod.find_installation() py3_dep = py3.dependency(required : false) +cc = meson.get_compiler('c') # Copy to the builddir so that blaster.py can find the built tachyon module # FIXME: We should automatically detect this case and append the correct paths @@ -20,6 +21,10 @@ with open(sys.argv[1], 'rb') as f: assert(f.read() == b'success') ''' if py3_dep.found() + message('Detected Python version: ' + py3_dep.version()) + if py3_dep.version().version_compare('>=3.8') and cc.get_id() == 'msvc' and cc.version().version_compare('<=19.00.24215.1') + error('MESON_SKIP_TEST: Python modules do not work with Python 3.8 and VS2015 or earlier.') + endif subdir('ext') out_txt = custom_target('tachyon flux', diff --git a/test cases/python3/2 extmodule/meson.build b/test cases/python3/2 extmodule/meson.build index 4916a69..def21b0 100644 --- a/test cases/python3/2 extmodule/meson.build +++ b/test cases/python3/2 extmodule/meson.build @@ -6,8 +6,17 @@ project('Python extension module', 'c', py3_mod = import('python3') py3 = py3_mod.find_python() py3_dep = dependency('python3', required : false) +cc = meson.get_compiler('c') if py3_dep.found() + message('Detected Python version: ' + py3_dep.version()) + # Building extensions for Python 3 using Visual Studio 2015 + # no longer works (or, rather, they build but don't run). + # Disable the tests in this case. + if py3_dep.version().version_compare('>=3.8') and cc.get_id() == 'msvc' and cc.version().version_compare('<=19.00.24215.1') + error('MESON_SKIP_TEST: Python modules do not work with Python 3.8 and VS2015 or earlier.') + endif + subdir('ext') test('extmod', diff --git a/test cases/python3/4 custom target depends extmodule/meson.build b/test cases/python3/4 custom target depends extmodule/meson.build index dd6fed0..d76aa36 100644 --- a/test cases/python3/4 custom target depends extmodule/meson.build +++ b/test cases/python3/4 custom target depends extmodule/meson.build @@ -6,6 +6,7 @@ project('Python extension module', 'c', py3_mod = import('python3') py3 = py3_mod.find_python() py3_dep = dependency('python3', required : false) +cc = meson.get_compiler('c') # Copy to the builddir so that blaster.py can find the built tachyon module # FIXME: We should automatically detect this case and append the correct paths @@ -20,6 +21,11 @@ with open(sys.argv[1], 'rb') as f: assert(f.read() == b'success') ''' if py3_dep.found() + message('Detected Python version: ' + py3_dep.version()) + if py3_dep.version().version_compare('>=3.8') and cc.get_id() == 'msvc' and cc.version().version_compare('<=19.00.24215.1') + error('MESON_SKIP_TEST: Python modules do not work with Python 3.8 and VS2015 or earlier.') + endif + subdir('ext') out_txt = custom_target('tachyon flux', |