Skip to content

meson: fix str[n]casecmp detection on clang-cl

Aleksandr Mezin requested to merge amezin/glib:fix-clang-cl-strcasecmp into master

Meson incorrectly detects strcasecmp, strncasecmp on clang-cl if prefix: is not specified for cc.has_function().

See https://github.com/mesonbuild/meson/issues/5628

Fixes #2337 (closed)

Before this change:

  • msvc was using _stricmp()
  • gcc on mingw was using strcasecmp()
  • gcc on linux was using strcasecmp()
  • clang-cl was trying to use strcasecmp()

After this change:

  • msvc is using _stricmp()
  • gcc on mingw is using strcasecmp()
  • gcc on linux is using strcasecmp()
  • clang-cl is using _stricmp()

Tests are still failing to build with clang-cl, but that's a separate issue.

Merge request reports