aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorFilipe Brandenburger <filbranden@google.com>2018-04-24 21:39:59 -0700
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2018-06-02 04:50:32 +0000
commit05c43cdcd19db98d53d5c9f1b50028d881471c2f (patch)
tree233a3a010cc132e4ce5cc26deb95afcd12243781 /mesonbuild/build.py
parent0ccc0e92d114a281ba99fd668f36e69670a0af68 (diff)
downloadmeson-05c43cdcd19db98d53d5c9f1b50028d881471c2f.zip
meson-05c43cdcd19db98d53d5c9f1b50028d881471c2f.tar.gz
meson-05c43cdcd19db98d53d5c9f1b50028d881471c2f.tar.bz2
Add 'install_mode' to all installable targets
This makes it possible to customize permissions of all installable targets, such as executable(), libraries, man pages, header files and custom or generated targets. This is useful, for instance, to install setuid/setgid binaries, which was hard to accomplish without access to this attribute.
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 0bcb98f..1e7f5fe 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -64,6 +64,7 @@ buildtarget_kwargs = set([
'install',
'install_rpath',
'install_dir',
+ 'install_mode',
'name_prefix',
'name_suffix',
'native',
@@ -668,6 +669,9 @@ class BuildTarget(Target):
def get_custom_install_dir(self):
return self.install_dir
+ def get_custom_install_mode(self):
+ return self.install_mode
+
def process_kwargs(self, kwargs, environment):
super().process_kwargs(kwargs)
self.copy_kwargs(kwargs)
@@ -745,6 +749,7 @@ This will become a hard error in a future Meson release.''')
# the list index of that item will not be installed
self.install_dir = typeslistify(kwargs.get('install_dir', [None]),
(str, bool))
+ self.install_mode = kwargs.get('install_mode', None)
main_class = kwargs.get('main_class', '')
if not isinstance(main_class, str):
raise InvalidArguments('Main class must be a string')
@@ -1626,6 +1631,7 @@ class CustomTarget(Target):
'capture',
'install',
'install_dir',
+ 'install_mode',
'build_always',
'depends',
'depend_files',
@@ -1774,9 +1780,11 @@ class CustomTarget(Target):
# If an item in this list is False, the output corresponding to
# the list index of that item will not be installed
self.install_dir = typeslistify(kwargs['install_dir'], (str, bool))
+ self.install_mode = kwargs.get('install_mode', None)
else:
self.install = False
self.install_dir = [None]
+ self.install_mode = None
self.build_always = kwargs.get('build_always', False)
if not isinstance(self.build_always, bool):
raise InvalidArguments('Argument build_always must be a boolean.')
@@ -1803,6 +1811,9 @@ class CustomTarget(Target):
def get_custom_install_dir(self):
return self.install_dir
+ def get_custom_install_mode(self):
+ return self.install_mode
+
def get_outputs(self):
return self.outputs