aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Nicolodi <daniele@grinta.net>2023-06-25 19:02:38 +0200
committerEli Schwartz <eschwartz93@gmail.com>2023-06-26 23:06:29 -0400
commitc900e6b0b321ceed4f269965741201f835d00a89 (patch)
treeb8556dcb9de60b977ab99ecfc2ad940aa3467e2a
parenta71846d7494f3035677bee5f38b3fc94fb18938b (diff)
downloadmeson-c900e6b0b321ceed4f269965741201f835d00a89.zip
meson-c900e6b0b321ceed4f269965741201f835d00a89.tar.gz
meson-c900e6b0b321ceed4f269965741201f835d00a89.tar.bz2
mintro: record subproject in install_plan
-rw-r--r--mesonbuild/mintro.py2
-rw-r--r--test cases/unit/99 install all targets/meson.build2
-rw-r--r--test cases/unit/99 install all targets/subprojects/subproject/aaa.txt1
-rw-r--r--test cases/unit/99 install all targets/subprojects/subproject/bbb.txt1
-rw-r--r--test cases/unit/99 install all targets/subprojects/subproject/meson.build5
-rw-r--r--unittests/allplatformstests.py45
6 files changed, 56 insertions, 0 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index c921ce6..ab303b3 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -137,6 +137,7 @@ def list_install_plan(installdata: backends.InstallData) -> T.Dict[str, T.Dict[s
os.path.join(installdata.build_dir, target.fname): {
'destination': target.out_name,
'tag': target.tag or None,
+ 'subproject': target.subproject or None,
}
for target in installdata.targets
},
@@ -157,6 +158,7 @@ def list_install_plan(installdata: backends.InstallData) -> T.Dict[str, T.Dict[s
entry = {
'destination': install_path_name,
'tag': data.tag or None,
+ 'subproject': data.subproject or None,
}
if key == 'install_subdirs':
diff --git a/test cases/unit/99 install all targets/meson.build b/test cases/unit/99 install all targets/meson.build
index 75b4590..c5f33a0 100644
--- a/test cases/unit/99 install all targets/meson.build
+++ b/test cases/unit/99 install all targets/meson.build
@@ -1,5 +1,7 @@
project('install tag', 'c')
+subproject('subproject')
+
subdir('subdir')
# Those files should not be tagged
diff --git a/test cases/unit/99 install all targets/subprojects/subproject/aaa.txt b/test cases/unit/99 install all targets/subprojects/subproject/aaa.txt
new file mode 100644
index 0000000..43d5a8e
--- /dev/null
+++ b/test cases/unit/99 install all targets/subprojects/subproject/aaa.txt
@@ -0,0 +1 @@
+AAA
diff --git a/test cases/unit/99 install all targets/subprojects/subproject/bbb.txt b/test cases/unit/99 install all targets/subprojects/subproject/bbb.txt
new file mode 100644
index 0000000..ba62923
--- /dev/null
+++ b/test cases/unit/99 install all targets/subprojects/subproject/bbb.txt
@@ -0,0 +1 @@
+BBB
diff --git a/test cases/unit/99 install all targets/subprojects/subproject/meson.build b/test cases/unit/99 install all targets/subprojects/subproject/meson.build
new file mode 100644
index 0000000..ff474ac
--- /dev/null
+++ b/test cases/unit/99 install all targets/subprojects/subproject/meson.build
@@ -0,0 +1,5 @@
+project('subproject')
+
+install_data('aaa.txt')
+
+install_data('bbb.txt', install_tag: 'data')
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index f270e51..c484f2d 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -4358,6 +4358,9 @@ class AllPlatformTests(BasePlatformTests):
Path(installpath, 'usr/share/foo2.h'),
Path(installpath, 'usr/share/out1.txt'),
Path(installpath, 'usr/share/out2.txt'),
+ Path(installpath, 'usr/share/install tag'),
+ Path(installpath, 'usr/share/install tag/aaa.txt'),
+ Path(installpath, 'usr/share/install tag/bbb.txt'),
}
def do_install(tags, expected_files, expected_scripts):
@@ -4417,140 +4420,182 @@ class AllPlatformTests(BasePlatformTests):
f'{self.builddir}/out1-notag.txt': {
'destination': '{datadir}/out1-notag.txt',
'tag': None,
+ 'subproject': None,
},
f'{self.builddir}/out2-notag.txt': {
'destination': '{datadir}/out2-notag.txt',
'tag': None,
+ 'subproject': None,
},
f'{self.builddir}/libstatic.a': {
'destination': '{libdir_static}/libstatic.a',
'tag': 'devel',
+ 'subproject': None,
},
f'{self.builddir}/' + exe_name('app'): {
'destination': '{bindir}/' + exe_name('app'),
'tag': 'runtime',
+ 'subproject': None,
},
f'{self.builddir}/' + exe_name('app-otherdir'): {
'destination': '{prefix}/otherbin/' + exe_name('app-otherdir'),
'tag': 'runtime',
+ 'subproject': None,
},
f'{self.builddir}/subdir/' + exe_name('app2'): {
'destination': '{bindir}/' + exe_name('app2'),
'tag': 'runtime',
+ 'subproject': None,
},
f'{self.builddir}/' + shared_lib_name('shared'): {
'destination': '{libdir_shared}/' + shared_lib_name('shared'),
'tag': 'runtime',
+ 'subproject': None,
},
f'{self.builddir}/' + shared_lib_name('both'): {
'destination': '{libdir_shared}/' + shared_lib_name('both'),
'tag': 'runtime',
+ 'subproject': None,
},
f'{self.builddir}/' + static_lib_name('both'): {
'destination': '{libdir_static}/' + static_lib_name('both'),
'tag': 'devel',
+ 'subproject': None,
},
f'{self.builddir}/' + shared_lib_name('bothcustom'): {
'destination': '{libdir_shared}/' + shared_lib_name('bothcustom'),
'tag': 'custom',
+ 'subproject': None,
},
f'{self.builddir}/' + static_lib_name('bothcustom'): {
'destination': '{libdir_static}/' + static_lib_name('bothcustom'),
'tag': 'custom',
+ 'subproject': None,
},
f'{self.builddir}/subdir/' + shared_lib_name('both2'): {
'destination': '{libdir_shared}/' + shared_lib_name('both2'),
'tag': 'runtime',
+ 'subproject': None,
},
f'{self.builddir}/subdir/' + static_lib_name('both2'): {
'destination': '{libdir_static}/' + static_lib_name('both2'),
'tag': 'devel',
+ 'subproject': None,
},
f'{self.builddir}/out1-custom.txt': {
'destination': '{datadir}/out1-custom.txt',
'tag': 'custom',
+ 'subproject': None,
},
f'{self.builddir}/out2-custom.txt': {
'destination': '{datadir}/out2-custom.txt',
'tag': 'custom',
+ 'subproject': None,
},
f'{self.builddir}/out3-custom.txt': {
'destination': '{datadir}/out3-custom.txt',
'tag': 'custom',
+ 'subproject': None,
},
f'{self.builddir}/subdir/out1.txt': {
'destination': '{datadir}/out1.txt',
'tag': None,
+ 'subproject': None,
},
f'{self.builddir}/subdir/out2.txt': {
'destination': '{datadir}/out2.txt',
'tag': None,
+ 'subproject': None,
},
f'{self.builddir}/out-devel.h': {
'destination': '{includedir}/out-devel.h',
'tag': 'devel',
+ 'subproject': None,
},
f'{self.builddir}/out3-notag.txt': {
'destination': '{datadir}/out3-notag.txt',
'tag': None,
+ 'subproject': None,
},
},
'configure': {
f'{self.builddir}/foo-notag.h': {
'destination': '{datadir}/foo-notag.h',
'tag': None,
+ 'subproject': None,
},
f'{self.builddir}/foo2-devel.h': {
'destination': '{includedir}/foo2-devel.h',
'tag': 'devel',
+ 'subproject': None,
},
f'{self.builddir}/foo-custom.h': {
'destination': '{datadir}/foo-custom.h',
'tag': 'custom',
+ 'subproject': None,
},
f'{self.builddir}/subdir/foo2.h': {
'destination': '{datadir}/foo2.h',
'tag': None,
+ 'subproject': None,
},
},
'data': {
f'{testdir}/bar-notag.txt': {
'destination': '{datadir}/bar-notag.txt',
'tag': None,
+ 'subproject': None,
},
f'{testdir}/bar-devel.h': {
'destination': '{includedir}/bar-devel.h',
'tag': 'devel',
+ 'subproject': None,
},
f'{testdir}/bar-custom.txt': {
'destination': '{datadir}/bar-custom.txt',
'tag': 'custom',
+ 'subproject': None,
},
f'{testdir}/subdir/bar2-devel.h': {
'destination': '{includedir}/bar2-devel.h',
'tag': 'devel',
+ 'subproject': None,
+ },
+ f'{testdir}/subprojects/subproject/aaa.txt': {
+ 'destination': '{datadir}/install tag/aaa.txt',
+ 'tag': None,
+ 'subproject': 'subproject',
+ },
+ f'{testdir}/subprojects/subproject/bbb.txt': {
+ 'destination': '{datadir}/install tag/bbb.txt',
+ 'tag': 'data',
+ 'subproject': 'subproject',
},
},
'headers': {
f'{testdir}/foo1-devel.h': {
'destination': '{includedir}/foo1-devel.h',
'tag': 'devel',
+ 'subproject': None,
},
f'{testdir}/subdir/foo3-devel.h': {
'destination': '{includedir}/foo3-devel.h',
'tag': 'devel',
+ 'subproject': None,
},
},
'install_subdirs': {
f'{testdir}/custom_files': {
'destination': '{datadir}/custom_files',
'tag': 'custom',
+ 'subproject': None,
'exclude_dirs': [],
'exclude_files': [],
},
f'{testdir}/excludes': {
'destination': '{datadir}/excludes',
'tag': 'custom',
+ 'subproject': None,
'exclude_dirs': ['excluded'],
'exclude_files': ['excluded.txt'],
}