qmlformat: don't build if commandlineparser not found
Task-number: QTBUG-133225 Change-Id: I8d21d16cc90e50b2ef56fcaeed5b8c3933ecbc9b Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
This commit is contained in:
parent
0cde2a84b9
commit
2dec2d82d0
|
@ -96,7 +96,10 @@ add_subdirectory(labs)
|
|||
|
||||
add_subdirectory(qmlcompiler)
|
||||
add_subdirectory(qmldom)
|
||||
add_subdirectory(qmlformat)
|
||||
|
||||
if (QT_FEATURE_commandlineparser)
|
||||
add_subdirectory(qmlformat)
|
||||
endif()
|
||||
|
||||
# Build qmlcachegen now, so that we can use it in src/imports.
|
||||
if(QT_FEATURE_xmlstreamwriter)
|
||||
|
|
|
@ -4,10 +4,8 @@
|
|||
#include "qqmlformatoptions_p.h"
|
||||
#include "qqmlformatsettings_p.h"
|
||||
|
||||
#if QT_CONFIG(commandlineparser)
|
||||
# include <QCommandLineParser>
|
||||
# include <QCommandLineOption>
|
||||
#endif
|
||||
#include <QCommandLineParser>
|
||||
#include <QCommandLineOption>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
|
@ -115,7 +113,6 @@ void QQmlFormatOptions::applySettings(const QQmlFormatSettings &settings)
|
|||
QQmlFormatOptions QQmlFormatOptions::buildCommandLineOptions(const QStringList &args)
|
||||
{
|
||||
QQmlFormatOptions options;
|
||||
#if QT_CONFIG(commandlineparser)
|
||||
QCommandLineParser parser;
|
||||
parser.setApplicationDescription(
|
||||
"Formats QML files according to the QML Coding Conventions."_L1);
|
||||
|
@ -263,7 +260,6 @@ QQmlFormatOptions QQmlFormatOptions::buildCommandLineOptions(const QStringList &
|
|||
options.mark(Settings::MaxColumnWidth);
|
||||
options.setMaxColumnWidth(maxColumnWidth);
|
||||
}
|
||||
#endif
|
||||
return options;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@ if(QT_FEATURE_commandlineparser)
|
|||
add_subdirectory(qmltc)
|
||||
add_subdirectory(qmltyperegistrar)
|
||||
add_subdirectory(qmljsrootgen)
|
||||
add_subdirectory(qmlformat)
|
||||
endif()
|
||||
add_subdirectory(qmlimportscanner)
|
||||
add_subdirectory(qmlformat)
|
||||
if(TARGET Qt::LanguageServerPrivate AND QT_FEATURE_commandlineparser AND QT_FEATURE_filesystemwatcher)
|
||||
if (NOT CMAKE_CROSSCOMPILING OR QT_FORCE_BUILD_TOOLS)
|
||||
add_subdirectory(qmlls)
|
||||
|
|
Loading…
Reference in New Issue