]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: Handle -Dtests=enabled with Clang
authorAndrea Bolognani <abologna@redhat.com>
Tue, 3 Oct 2023 12:52:45 +0000 (14:52 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 26 Oct 2023 09:31:21 +0000 (11:31 +0200)
There are some cases in which we automatically disable tests when
using Clang as the compiler. If the user has explicitly asked for
tests to be enabled, however, we should error out instead of
silently disabling things.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
meson.build

index a372f99c21f8ae604163255b4aa85a0117d701cc..ea8ee84ba0a8985d0d40e2a41c8eca56ceb8e6e1 100644 (file)
@@ -2035,7 +2035,11 @@ if build_tests[0] and \
    # If CLang doesn't support -fsemantic-interposition then our
    # mocking doesn't work. The best we can do is to not run the
    # test suite.
-   build_tests = [ false, '!!! Forcibly disabling tests because CLang lacks -fsemantic-interposition. Update CLang or disable optimization !!!' ]
+   msg = 'Forcibly disabling tests because CLang lacks -fsemantic-interposition. Update CLang or disable optimization'
+   if get_option('tests').enabled()
+     error(msg)
+   endif
+   build_tests = [ false, '!!! @0@ !!!'.format(msg) ]
 endif
 
 if get_option('expensive_tests').auto()