aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-02-12 23:42:20 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-02-12 23:42:20 +0200
commit819da091c260cc85757d5b90c6e906a2f33dde1f (patch)
tree4797de9c329adef45173f14db99fbc5b0c496070
parentfc08f60b9fbb4524c08e37a0b7a5c87c87efe608 (diff)
downloadmeson-819da091c260cc85757d5b90c6e906a2f33dde1f.zip
meson-819da091c260cc85757d5b90c6e906a2f33dde1f.tar.gz
meson-819da091c260cc85757d5b90c6e906a2f33dde1f.tar.bz2
Use deterministic mode in ar when it is available.
-rw-r--r--mesonbuild/compilers.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 078e87c..0f29808 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -1803,11 +1803,17 @@ class VisualStudioLinker():
return args
class ArLinker():
- std_args = ['csr']
def __init__(self, exelist):
self.exelist = exelist
self.id = 'ar'
+ pc = subprocess.Popen(self.exelist + ['-h'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
+ (stdo, _) = pc.communicate()
+ # Enable deterministic builds if they are available.
+ if b'[D]' in stdo:
+ self.std_args = ['csrD']
+ else:
+ self.std_args = ['csr']
def build_rpath_args(self, build_dir, rpath_paths, install_rpath):
return []