aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Klumpp <matthias@tenstral.net>2016-08-22 20:06:56 +0200
committerMatthias Klumpp <matthias@tenstral.net>2016-08-22 21:07:58 +0200
commit76fe77f9a85c822d2ec257ad60685ec2372189ea (patch)
tree16d4e23c601bcca3095ff7bbb43dc442b2c24e4f
parentfae8ad90a45e61caaec7e74c510ac092dc347098 (diff)
downloadmeson-76fe77f9a85c822d2ec257ad60685ec2372189ea.zip
meson-76fe77f9a85c822d2ec257ad60685ec2372189ea.tar.gz
meson-76fe77f9a85c822d2ec257ad60685ec2372189ea.tar.bz2
Don't automatically override the -L flag of D compilers
Works around / resolves #702.
-rw-r--r--mesonbuild/compilers.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 64a1410..40866df 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -1542,7 +1542,7 @@ class DCompiler(Compiler):
for la in linkargs:
dcargs.append('-L' + la.strip())
continue
- elif arg.startswith(('-l', '-L')):
+ elif arg.startswith('-l'):
# translate library link flag
dcargs.append('-L' + arg)
continue
@@ -1581,6 +1581,9 @@ class GnuDCompiler(DCompiler):
def get_werror_args(self):
return ['-Werror']
+ def get_linker_search_args(self, dirname):
+ return ['-L'+dirname]
+
def get_buildtype_args(self, buildtype):
return d_gdc_buildtype_args[buildtype]
@@ -1627,6 +1630,12 @@ class LLVMDCompiler(DCompiler):
def get_pic_args(self):
return ['-relocation-model=pic']
+ def get_linker_search_args(self, dirname):
+ # -L is recognized as "add this to the search path" by the linker,
+ # while the compiler recognizes it as "pass to linker". So, the first
+ # -L is for the compiler, telling it to pass the second -L to the linker.
+ return ['-L-L'+dirname]
+
def unix_link_flags_to_native(self, args):
return self.translate_args_to_nongnu(args)
@@ -1664,6 +1673,12 @@ class DmdDCompiler(DCompiler):
def get_coverage_args(self):
return ['-cov']
+ def get_linker_search_args(self, dirname):
+ # -L is recognized as "add this to the search path" by the linker,
+ # while the compiler recognizes it as "pass to linker". So, the first
+ # -L is for the compiler, telling it to pass the second -L to the linker.
+ return ['-L-L'+dirname]
+
def get_buildtype_args(self, buildtype):
return d_dmd_buildtype_args[buildtype]