diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 3df996bc623..1f760cbd3aa 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -796,7 +796,8 @@ qt_internal_extend_target(Core CONDITION WIN32 text/qlocale_win.cpp ) -qt_internal_extend_target(Core CONDITION WIN32 AND MSVC +# On MS-Win, clang has two flavors, one of which immitates MSVC (so claims to be it) +qt_internal_extend_target(Core CONDITION WIN32 AND MSVC AND NOT CLANG LIBRARIES runtimeobject ) diff --git a/src/corelib/text/qlocale_win.cpp b/src/corelib/text/qlocale_win.cpp index d2dd07e5497..191533c8863 100644 --- a/src/corelib/text/qlocale_win.cpp +++ b/src/corelib/text/qlocale_win.cpp @@ -51,7 +51,7 @@ # include #endif -#if defined(Q_CC_MSVC) +#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG) # include // Workaround for Windows SDK bug. // See https://github.com/microsoft/Windows.UI.Composition-Win32-Samples/issues/47 @@ -63,7 +63,7 @@ namespace winrt::impl # include # include # include -#endif // defined(Q_CC_MSVC) +#endif // defined(Q_CC_MSVC) && !defined(Q_CC_CLANG) QT_BEGIN_NAMESPACE @@ -630,7 +630,7 @@ QVariant QSystemLocalePrivate::toCurrencyString(const QSystemLocale::CurrencyToS QVariant QSystemLocalePrivate::uiLanguages() { QStringList result; -#if defined(Q_CC_MSVC) // msvc supports WinRT calls +#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG) // msvc supports WinRT calls using namespace winrt; using namespace Windows::Foundation; using namespace Windows::System::UserProfile; @@ -639,7 +639,7 @@ QVariant QSystemLocalePrivate::uiLanguages() result << QString::fromStdString(winrt::to_string(lang)); if (!result.isEmpty()) return result; // else just fall back to WIN32 API implementation -#endif // defined(Q_CC_MSVC) +#endif // defined(Q_CC_MSVC) && !defined(Q_CC_CLANG) // mingw and clang still have to use Win32 API unsigned long cnt = 0; QVarLengthArray buf(64);