From fc72aa1e65cbe6b36af16c480b8a892bdef7638a Mon Sep 17 00:00:00 2001 From: Matthias Klumpp Date: Mon, 19 Dec 2016 21:23:07 +0100 Subject: ldc/dmd: Properly set warning arguments --- mesonbuild/compilers.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index ba8cba1..5d92d5c 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -1754,10 +1754,13 @@ class LLVMDCompiler(DCompiler): return ['-I' + path] def get_warn_args(self, level): - if level == '2': - return ['-wi'] + if level == '2' or level == '3': + return ['-wi', '-dw'] else: - return ['-w'] + return ['-wi'] + + def get_werror_args(self): + return ['-w'] def get_coverage_args(self): return ['-cov'] @@ -1809,7 +1812,7 @@ class DmdDCompiler(DCompiler): return ['-I' + path] def get_warn_args(self, level): - return [] + return ['-wi'] def get_coverage_args(self): return ['-cov'] -- cgit v1.1 From a9c09e6004ff1b5344782e698549e9fba041fca9 Mon Sep 17 00:00:00 2001 From: Matthias Klumpp Date: Mon, 19 Dec 2016 23:24:03 +0100 Subject: ldc: Protect linker flags from deduplication This is the better way to pass arguments through to the linker when compiling D code with LDC. --- mesonbuild/backend/backends.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild') diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index dc39ce4..10167e8 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -373,7 +373,7 @@ class Backend(): if not isinstance(d, (build.StaticLibrary, build.SharedLibrary)): raise RuntimeError('Tried to link with a non-library target "%s".' % d.get_basename()) if isinstance(compiler, compilers.LLVMDCompiler): - args.extend(['-L', self.get_target_filename_for_linking(d)]) + args += ['-L' + self.get_target_filename_for_linking(d)] else: args.append(self.get_target_filename_for_linking(d)) # If you have executable e that links to shared lib s1 that links to shared library s2 -- cgit v1.1 From c6fb5aec58af87fcb26943bae57b4ba2abd24b74 Mon Sep 17 00:00:00 2001 From: Matthias Klumpp Date: Tue, 20 Dec 2016 23:50:37 +0100 Subject: d: Correctly set SONAME on D shared libraries All D compilers use the system linker, which is very convenient here. --- mesonbuild/compilers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mesonbuild') diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index 5d92d5c..42c55e9 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -1635,7 +1635,8 @@ class DCompiler(Compiler): return ['-shared'] def get_soname_args(self, prefix, shlib_name, suffix, path, soversion, is_shared_module): - return [] + # FIXME: Make this work for Windows, MacOS and cross-compiling + return get_gcc_soname_args(GCC_STANDARD, prefix, shlib_name, suffix, path, soversion, is_shared_module) def get_unittest_args(self): return ['-unittest'] -- cgit v1.1