aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
authorAleksey Gurtovoy <agurtovoy@acm.org>2019-09-03 16:43:48 -0500
committerJussi Pakkanen <jpakkane@gmail.com>2019-09-27 00:57:21 +0300
commit7dbabdc7b696aca4aadc3dfab5045a08662fdfde (patch)
tree6ece70f048f7f3f97a942283af892c2cc67b7420 /mesonbuild/compilers
parent534e94ffc35dae3a0b2cc9f1e60e7e452872c512 (diff)
downloadmeson-7dbabdc7b696aca4aadc3dfab5045a08662fdfde.zip
meson-7dbabdc7b696aca4aadc3dfab5045a08662fdfde.tar.gz
meson-7dbabdc7b696aca4aadc3dfab5045a08662fdfde.tar.bz2
Correctly handle platform-specific LDFLAGS options
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/compilers.py5
-rw-r--r--mesonbuild/compilers/mixins/visualstudio.py12
2 files changed, 17 insertions, 0 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index bb698fc..2c9508b 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -900,6 +900,11 @@ class Compiler:
"Always returns a copy that can be independently mutated"
return args[:]
+ @classmethod
+ def native_args_to_unix(cls, args: typing.List[str]) -> typing.List[str]:
+ "Always returns a copy that can be independently mutated"
+ return args[:]
+
def find_library(self, *args, **kwargs):
raise EnvironmentException('Language {} does not support library finding.'.format(self.get_display_language()))
diff --git a/mesonbuild/compilers/mixins/visualstudio.py b/mesonbuild/compilers/mixins/visualstudio.py
index 5fe8599..48a2229 100644
--- a/mesonbuild/compilers/mixins/visualstudio.py
+++ b/mesonbuild/compilers/mixins/visualstudio.py
@@ -234,6 +234,18 @@ class VisualStudioLikeCompiler(metaclass=abc.ABCMeta):
result.append(i)
return result
+ @classmethod
+ def native_args_to_unix(cls, args: typing.List[str]) -> typing.List[str]:
+ result = []
+ for arg in args:
+ if arg.startswith('/LIBPATH:'):
+ result.append('-L' + arg[9:])
+ elif arg.endswith(('.a', '.lib')) and not os.path.isabs(arg):
+ result.append('-l' + arg)
+ else:
+ result.append(arg)
+ return result
+
def get_werror_args(self) -> typing.List[str]:
return ['/WX']