aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-02-10 21:26:27 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2013-02-10 21:26:27 +0200
commit26ff3fa23e07f8c4409675d52e30eeef11b63a66 (patch)
treea07221915b94801e08a01c5508e2fdd52a8e72b7
parent75dbc2abdb4103a59a7b348b29fc5b48da7e9012 (diff)
downloadmeson-26ff3fa23e07f8c4409675d52e30eeef11b63a66.zip
meson-26ff3fa23e07f8c4409675d52e30eeef11b63a66.tar.gz
meson-26ff3fa23e07f8c4409675d52e30eeef11b63a66.tar.bz2
Strip on install and generate pch properly.
-rwxr-xr-xbuilder_install.py10
-rwxr-xr-xgenerators.py8
2 files changed, 16 insertions, 2 deletions
diff --git a/builder_install.py b/builder_install.py
index 9df5612..5f9722d 100755
--- a/builder_install.py
+++ b/builder_install.py
@@ -74,10 +74,20 @@ def install_targets(d):
fname = os.path.split(fullfilename)[1]
aliases = t[2]
outname = os.path.join(outdir, fname)
+ should_strip = t[3]
print('Installing %s to %s' % (fname, outdir))
os.makedirs(outdir, exist_ok=True)
shutil.copyfile(fullfilename, outname)
shutil.copystat(fullfilename, outname)
+ if should_strip:
+ print('Stripping target')
+ ps = subprocess.Popen(['strip', outname], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ (stdo, stde) = ps.communicate()
+ if ps.returncode != 0:
+ print('Could not strip file.\n')
+ print('Stdout:\n%s\n' % stdo.decode())
+ print('Stderr:\n%s\n' % stde.decode())
+ sys.exit(1)
for alias in aliases:
os.symlink(fname, os.path.join(outdir, alias))
p = subprocess.Popen([d.depfixer, outname, d.dep_prefix], stdout=subprocess.PIPE,
diff --git a/generators.py b/generators.py
index 41d8722..6f4eb9c 100755
--- a/generators.py
+++ b/generators.py
@@ -198,13 +198,14 @@ class NinjaGenerator(Generator):
libdir = os.path.join(prefix, self.environment.get_libdir())
bindir = os.path.join(prefix, self.environment.get_bindir())
+ should_strip = self.environment.options.strip
for t in self.build.get_targets().values():
if t.should_install():
if isinstance(t, interpreter.Executable):
outdir = bindir
else:
outdir = libdir
- i = [os.path.join(self.environment.get_build_dir(), self.get_target_filename(t)), outdir, t.get_aliaslist()]
+ i = [os.path.join(self.environment.get_build_dir(), self.get_target_filename(t)), outdir, t.get_aliaslist(), should_strip]
d.targets.append(i)
def generate_header_install(self, d):
@@ -360,12 +361,15 @@ class NinjaGenerator(Generator):
src = os.path.join(self.build_to_src, target.get_source_subdir(), pch)
dst = os.path.join(self.get_target_private_dir(target),
os.path.split(pch)[-1] + '.' + compiler.get_pch_suffix())
+ dep = dst + '.' + compiler.get_depfile_suffix()
build = 'build %s: %s %s\n' % (ninja_quote(dst),
ninja_quote(compiler.get_language() + '_COMPILER'),
ninja_quote(src))
- flags = ' FLAGS = %s\n\n' % ' '.join([ninja_quote(t) for t in commands])
+ flags = ' FLAGS = %s\n' % ' '.join([ninja_quote(t) for t in commands])
+ depfile = ' DEPFILE = %s\n\n' % ninja_quote(dep)
outfile.write(build)
outfile.write(flags)
+ outfile.write(depfile)
def generate_link(self, target, outfile, outname, obj_list):
if isinstance(target, interpreter.StaticLibrary):