From: Steinar H. Gunderson Date: Sat, 17 Oct 2020 12:33:12 +0000 (+0200) Subject: Fix the function multiversioning Meson test. X-Git-Tag: 1.0.6~6 X-Git-Url: https://git.sesse.net/?p=plocate;a=commitdiff_plain;h=27d93fde59be258d9e113ca09ece3c0527b289ec Fix the function multiversioning Meson test. The old one was seemingly too lenient, and would have false positives. --- diff --git a/meson.build b/meson.build index 0c79ddf..e563260 100644 --- a/meson.build +++ b/meson.build @@ -15,7 +15,9 @@ endif # Function multiversioning is x86-only _and_ not available on certain targets # (they need “ifunc”, indirect functions, a GNU extension). -code = '__attribute__((target("default"))) void func();' +code = '''__attribute__((target("default"))) void foo(); +__attribute__((target("sse2"))) void foo(); +void bar() { foo(); }''' if cxx.compiles(code, name: 'function multiversioning') add_project_arguments('-DHAS_FUNCTION_MULTIVERSIONING', language: 'cpp') endif