aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/python.py
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2018-04-06 22:43:19 +0200
committerMathieu Duponchelle <mathieu@centricular.com>2018-04-07 00:37:28 +0200
commitad296976f079cd185ab7361e3e4b18c6bf684090 (patch)
treed74590742ae1e81dd3757cb38d86ddda42437a73 /mesonbuild/modules/python.py
parent423f2f5c9218c2fc585f502587bda893b1869d61 (diff)
downloadmeson-ad296976f079cd185ab7361e3e4b18c6bf684090.zip
meson-ad296976f079cd185ab7361e3e4b18c6bf684090.tar.gz
meson-ad296976f079cd185ab7361e3e4b18c6bf684090.tar.bz2
[fixup]: extension_module: allow specifying install_dir OR subdir
Diffstat (limited to 'mesonbuild/modules/python.py')
-rw-r--r--mesonbuild/modules/python.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
index d1f4db7..23ef72f 100644
--- a/mesonbuild/modules/python.py
+++ b/mesonbuild/modules/python.py
@@ -35,7 +35,6 @@ from ..dependencies.base import (
mod_kwargs = set(['subdir'])
mod_kwargs.update(shlib_kwargs)
-mod_kwargs -= set(['install_dir', 'install_rpath'])
def run_command(python, command):
@@ -245,11 +244,15 @@ class PythonHolder(ExternalProgramHolder, InterpreterObject):
if 'name_suffix' in kwargs:
raise mesonlib.MesonException('Name_suffix is set automatically, specifying it is forbidden.')
- subdir = kwargs.pop('subdir', '')
- if not isinstance(subdir, str):
- raise InvalidArguments('"subdir" argument must be a string.')
+ if 'subdir' in kwargs and 'install_dir' in kwargs:
+ raise InvalidArguments('"subdir" and "install_dir" are mutually exclusive')
- kwargs['install_dir'] = os.path.join(self.platlib_install_path, subdir)
+ if 'subdir' in kwargs:
+ subdir = kwargs.pop('subdir', '')
+ if not isinstance(subdir, str):
+ raise InvalidArguments('"subdir" argument must be a string.')
+
+ kwargs['install_dir'] = os.path.join(self.platlib_install_path, subdir)
suffix = self.variables.get('EXT_SUFFIX') or self.variables.get('SO') or self.variables.get('.so')