mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
meson: Don't build tests when CLang lacks -fsemantic-interposition
There are some CLang versions that do not support -fsemantic-interposition. If that's the case, the code is optimized so much that our mocking no longer works. Therefore, disable tests and produce a warning. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
7334972c9a
commit
7944700b40
14
meson.build
14
meson.build
@ -2035,8 +2035,18 @@ subdir('src')
|
||||
|
||||
subdir('tools')
|
||||
|
||||
build_tests = not get_option('tests').disabled()
|
||||
if build_tests
|
||||
build_tests = [ not get_option('tests').disabled() ]
|
||||
if build_tests[0] and \
|
||||
cc.get_id() == 'clang' and \
|
||||
not supported_cc_flags.contains('-fsemantic-interposition') \
|
||||
and get_option('optimization') != '0'
|
||||
# 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 !!!' ]
|
||||
endif
|
||||
|
||||
if build_tests[0]
|
||||
subdir('tests')
|
||||
endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user