Add a conditional to handle pragma message when MSVC is used

MSVC does not support the warning preprocessor directive. To ensure
compatibility across compilers, add a conditional check to instead use
pragma message with MSVC.

Change-Id: If380ebf8b2a5bb771dbbb374158e619ce1090e65
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Frédéric Lefebvre 2025-08-27 16:31:46 +02:00 committed by Frederic Lefebvre
parent eb4e880142
commit 60d02e4f3f
1 changed files with 2 additions and 0 deletions

View File

@ -10,6 +10,8 @@
#include <QtQml/QQmlContext> #include <QtQml/QQmlContext>
#include <QQuickWidget> #include <QQuickWidget>
#include <QQuickItem> #include <QQuickItem>
#elif defined(Q_CC_MSVC)
#pragma message "Building without Quick UI"
#else #else
#warning "Building without Quick UI" #warning "Building without Quick UI"
#endif #endif