aboutsummaryrefslogtreecommitdiff
path: root/rustrunner.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2014-06-23 20:53:20 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2014-06-23 20:53:20 +0300
commit2d23a44e6e6f5baf5d076015f583c61bebfd9fde (patch)
tree8b8554d722f46587a7710a5ac39cf51fd08004ca /rustrunner.py
parent2366f822d23792fa618da91989cee8e6785960fe (diff)
downloadmeson-2d23a44e6e6f5baf5d076015f583c61bebfd9fde.zip
meson-2d23a44e6e6f5baf5d076015f583c61bebfd9fde.tar.gz
meson-2d23a44e6e6f5baf5d076015f583c61bebfd9fde.tar.bz2
Deal with Rust static libraries, too.
Diffstat (limited to 'rustrunner.py')
-rwxr-xr-xrustrunner.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/rustrunner.py b/rustrunner.py
index 4af196b..57e6124 100755
--- a/rustrunner.py
+++ b/rustrunner.py
@@ -30,6 +30,11 @@ def delete_old_crates(target_name, target_type):
crates = glob.glob(base + '-*' + suffix)
crates = [(os.stat(i).st_mtime, i) for i in crates]
[os.unlink(c[1]) for c in sorted(crates)[:-1]]
+ if target_type == 'lib':
+ (base, suffix) = os.path.splitext(target_name)
+ crates = glob.glob(base + '-*' + '.rlib') # Rust does not use .a
+ crates = [(os.stat(i).st_mtime, i) for i in crates]
+ [os.unlink(c[1]) for c in sorted(crates)[:-1]]
def invoke_rust(rustc_command):
return subprocess.call(rustc_command, shell=False)