diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-04-20 14:18:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-20 14:18:27 +0300 |
commit | 5c85b5028080e74b3a74f9e0d63166c3c3ca15e6 (patch) | |
tree | dbf4c168c34a1b67fc2f107ebc6aba593a4c66e4 | |
parent | bf65660509bcea67b3a25477c89807a673248b08 (diff) | |
parent | 0ec71fff34b3a120b4a688e4dd79a64dd2b0f6a1 (diff) | |
download | meson-5c85b5028080e74b3a74f9e0d63166c3c3ca15e6.zip meson-5c85b5028080e74b3a74f9e0d63166c3c3ca15e6.tar.gz meson-5c85b5028080e74b3a74f9e0d63166c3c3ca15e6.tar.bz2 |
Merge pull request #5284 from makise-homura/update_lcc_support
Update lcc support
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/compilers.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/cpp.py | 15 | ||||
-rwxr-xr-x | run_unittests.py | 6 |
4 files changed, 16 insertions, 9 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 405bd26..08b14c8 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -2418,7 +2418,7 @@ rule FORTRAN_DEP_HACK%s guessed_dependencies = [] # TODO The get_library_naming requirement currently excludes link targets that use d or fortran as their main linker if hasattr(linker, 'get_library_naming'): - search_dirs = tuple(search_dirs) + linker.get_library_dirs(self.environment) + search_dirs = tuple(search_dirs) + tuple(linker.get_library_dirs(self.environment)) static_patterns = linker.get_library_naming(self.environment, LibType.STATIC, strict=True) shared_patterns = linker.get_library_naming(self.environment, LibType.SHARED, strict=True) for libname in libs: diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index e29ca55..3459a8f 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -1736,7 +1736,7 @@ class ElbrusCompiler(GnuCompiler): # FIXME: use _build_wrapper to call this so that linker flags from the env # get applied - def get_library_dirs(self, env): + def get_library_dirs(self, env, elf_class = None): os_env = os.environ.copy() os_env['LC_ALL'] = 'C' stdo = Popen_safe(self.exelist + ['--print-search-dirs'], env=os_env)[1] diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 67de684..87e6ffc 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -115,8 +115,8 @@ class CPPCompiler(CCompiler): 'gnu++17': 'gnu++1z' } - # Currently, remapping is only supported for Clang and GCC - assert(self.id in frozenset(['clang', 'gcc'])) + # Currently, remapping is only supported for Clang, Elbrus and GCC + assert(self.id in frozenset(['clang', 'lcc', 'gcc'])) if cpp_std not in CPP_FALLBACKS: # 'c++03' and 'c++98' don't have fallback types @@ -251,10 +251,13 @@ class ElbrusCPPCompiler(GnuCPPCompiler, ElbrusCompiler): # It does not support c++/gnu++ 17 and 1z, but still does support 0x, 1y, and gnu++98. def get_options(self): opts = CPPCompiler.get_options(self) - opts['cpp_std'] = coredata.UserComboOption('cpp_std', 'C++ language standard to use', - ['none', 'c++98', 'c++03', 'c++0x', 'c++11', 'c++14', 'c++1y', - 'gnu++98', 'gnu++03', 'gnu++0x', 'gnu++11', 'gnu++14', 'gnu++1y'], - 'none') + opts.update({'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use', + ['none', 'c++98', 'c++03', 'c++0x', 'c++11', 'c++14', 'c++1y', + 'gnu++98', 'gnu++03', 'gnu++0x', 'gnu++11', 'gnu++14', 'gnu++1y'], + 'none'), + 'cpp_debugstl': coredata.UserBooleanOption('cpp_debugstl', + 'STL debug mode', + False)}) return opts # Elbrus C++ compiler does not have lchmod, but there is only linker warning, not compiler error. diff --git a/run_unittests.py b/run_unittests.py index 316525d..faef00f 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -5841,7 +5841,11 @@ class NativeFileTests(BasePlatformTests): @skip_if_env_set('FC') def test_fortran_compiler(self): def cb(comp): - if comp.id == 'gcc': + if comp.id == 'lcc': + if shutil.which('lfortran'): + return 'lfortran', 'lcc' + raise unittest.SkipTest('No alternate Fortran implementation.') + elif comp.id == 'gcc': if shutil.which('ifort'): return 'ifort', 'intel' elif shutil.which('flang'): |