]> git.sesse.net Git - plocate/commitdiff
Fix the function multiversioning Meson test.
authorSteinar H. Gunderson <steinar+git@gunderson.no>
Sat, 17 Oct 2020 12:33:12 +0000 (14:33 +0200)
committerSteinar H. Gunderson <steinar+git@gunderson.no>
Sat, 17 Oct 2020 12:33:12 +0000 (14:33 +0200)
The old one was seemingly too lenient, and would have false positives.

meson.build

index 0c79ddf04c98608ebdd7125834ada46a176fdc96..e5632607a9bd12cef04147bb4b4cbc0bbf02a3a9 100644 (file)
@@ -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