diff options
-rw-r--r-- | mesonbuild/build.py | 4 | ||||
-rw-r--r-- | test cases/common/44 pkgconfig-gen/meson.build | 2 | ||||
-rw-r--r-- | test cases/common/44 pkgconfig-gen/simple7.c | 0 | ||||
-rw-r--r-- | test cases/failing/136 target with no sources/test.json | 7 | ||||
-rw-r--r-- | test cases/warning/8 target with no sources/meson.build (renamed from test cases/failing/136 target with no sources/meson.build) | 0 | ||||
-rw-r--r-- | test cases/warning/8 target with no sources/test.json | 7 | ||||
-rw-r--r-- | unittests/allplatformstests.py | 2 |
7 files changed, 12 insertions, 10 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index cfba923..041cb19 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -760,7 +760,9 @@ class BuildTarget(Target): if not any([[src for src in self.sources if not is_header(src)], self.generated, self.objects, self.link_whole_targets, self.structured_sources, kwargs.pop('_allow_no_sources', False)]): - raise MesonException(f'Build target {name} has no sources.') + mlog.warning(f'Build target {name} has no sources. ' + 'This was never supposed to be allowed but did because of a bug, ' + 'support will be removed in a future release of Meson') self.check_unknown_kwargs(kwargs) self.validate_install() self.check_module_linking() diff --git a/test cases/common/44 pkgconfig-gen/meson.build b/test cases/common/44 pkgconfig-gen/meson.build index 624126c..fd6371e 100644 --- a/test cases/common/44 pkgconfig-gen/meson.build +++ b/test cases/common/44 pkgconfig-gen/meson.build @@ -189,7 +189,7 @@ endtestcase # Make sure the -uninstalled.pc file contains both include directories. # See dependencies/test2.c that gets built against both simple7.pc and # simple7-uninstalled.pc. -simple7 = library('simple7', 'simple7.c', include_directories: 'inc1') +simple7 = library('simple7', include_directories: 'inc1') dep = declare_dependency(include_directories: 'inc2') install_headers('inc1/inc1.h', 'inc2/inc2.h') pkgg.generate(simple7, libraries: dep) diff --git a/test cases/common/44 pkgconfig-gen/simple7.c b/test cases/common/44 pkgconfig-gen/simple7.c deleted file mode 100644 index e69de29..0000000 --- a/test cases/common/44 pkgconfig-gen/simple7.c +++ /dev/null diff --git a/test cases/failing/136 target with no sources/test.json b/test cases/failing/136 target with no sources/test.json deleted file mode 100644 index 9cef755..0000000 --- a/test cases/failing/136 target with no sources/test.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "stdout": [ - { - "line": "test cases/failing/136 target with no sources/meson.build:3:0: ERROR: Build target no sources has no sources." - } - ] -} diff --git a/test cases/failing/136 target with no sources/meson.build b/test cases/warning/8 target with no sources/meson.build index 2a8ee11..2a8ee11 100644 --- a/test cases/failing/136 target with no sources/meson.build +++ b/test cases/warning/8 target with no sources/meson.build diff --git a/test cases/warning/8 target with no sources/test.json b/test cases/warning/8 target with no sources/test.json new file mode 100644 index 0000000..30e5b05 --- /dev/null +++ b/test cases/warning/8 target with no sources/test.json @@ -0,0 +1,7 @@ +{ + "stdout": [ + { + "line": "WARNING: Build target no sources has no sources. This was never supposed to be allowed but did because of a bug, support will be removed in a future release of Meson" + } + ] +} diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py index 83bfad0..5e54466 100644 --- a/unittests/allplatformstests.py +++ b/unittests/allplatformstests.py @@ -4819,7 +4819,7 @@ class AllPlatformTests(BasePlatformTests): for_machine=MachineChoice.HOST, sources=[], structured_sources=None, objects=[], environment=env, compilers=env.coredata.compilers[MachineChoice.HOST], - kwargs={'_allow_no_sources': True}) + kwargs={}) target.process_compilers_late() return target.filename |