From cef672609c101ed359828c7e4b7762f7f464fa20 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 8 Nov 2020 00:33:12 +0100
Subject: [PATCH] Support finding static MariaDB client library

We need to reverse the order to look for mariadb first (and only then
for mysql) because otherwise it would pick up the static library
"libmysqlclient.a" (provided by mingw-w64-mariadb-connector-c during
the shared build (leading to linker errors).

Change-Id: I8f9ba27e638619dba411ad0e37f2f03eab4775bf
---
 cmake/FindMySQL.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/qtbase/cmake/FindMySQL.cmake b/qtbase/cmake/FindMySQL.cmake
index b61d0107f25..6fb26e51f13 100644
--- a/qtbase/cmake/FindMySQL.cmake
+++ b/qtbase/cmake/FindMySQL.cmake
@@ -63,13 +63,13 @@ find_path(MySQL_INCLUDE_DIR
 
 find_library(MySQL_LIBRARY
              NO_PACKAGE_ROOT_PATH
-             NAMES libmysql mysql mysqlclient libmariadb mariadb
+             NAMES libmariadb mariadb mariadbclient libmysql mysql mysqlclient
              HINTS ${MySQL_library_hints})
 
 if(MySQL_library_hints_debug)
     find_library(MySQL_LIBRARY_DEBUG
                  NO_PACKAGE_ROOT_PATH
-                 NAMES libmysql mysql mysqlclient libmariadb mariadb
+                 NAMES libmariadb mariadb mariadbclient libmysql mysql mysqlclient
                  HINTS ${MySQL_library_hints_debug})
 endif()
 
