forked from qt-creator/qt-creator
CMake: Do not map all unknown build target types to "ExecutableType"
There is UtilityType now, so use that if there is no executable being generated. Change-Id: I9e8d512077b8352ec056b49c8db03644482b8fbc Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -240,8 +240,11 @@ void CMakeCbpParser::parseBuildTarget()
|
||||
readNext();
|
||||
if (isEndElement()) {
|
||||
if (!m_buildTarget.title.endsWith(QLatin1String("/fast"))
|
||||
&& !m_buildTarget.title.endsWith(QLatin1String("_automoc")))
|
||||
&& !m_buildTarget.title.endsWith(QLatin1String("_automoc"))) {
|
||||
if (m_buildTarget.executable.isEmpty() && m_buildTarget.targetType == ExecutableType)
|
||||
m_buildTarget.targetType = UtilityType;
|
||||
m_buildTargets.append(m_buildTarget);
|
||||
}
|
||||
return;
|
||||
} else if (name() == QLatin1String("Compiler")) {
|
||||
parseCompiler();
|
||||
@@ -264,8 +267,14 @@ void CMakeCbpParser::parseBuildTargetOption()
|
||||
m_buildTarget.executable = tool->mapAllPaths(m_kit, m_buildTarget.executable);
|
||||
} else if (attributes().hasAttribute(QLatin1String("type"))) {
|
||||
const QStringRef value = attributes().value(QLatin1String("type"));
|
||||
if (value == QLatin1String("2") || value == QLatin1String("3"))
|
||||
m_buildTarget.targetType = TargetType(value.toInt());
|
||||
if (value == "0" || value == "1")
|
||||
m_buildTarget.targetType = ExecutableType;
|
||||
else if (value == "2")
|
||||
m_buildTarget.targetType = StaticLibraryType;
|
||||
else if (value == "3")
|
||||
m_buildTarget.targetType = DynamicLibraryType;
|
||||
else
|
||||
m_buildTarget.targetType = UtilityType;
|
||||
} else if (attributes().hasAttribute(QLatin1String("working_dir"))) {
|
||||
m_buildTarget.workingDirectory = attributes().value(QLatin1String("working_dir")).toString();
|
||||
|
||||
|
||||
@@ -762,7 +762,7 @@ void CMakeBuildTarget::clear()
|
||||
workingDirectory.clear();
|
||||
sourceDirectory.clear();
|
||||
title.clear();
|
||||
targetType = ExecutableType;
|
||||
targetType = UtilityType;
|
||||
includeFiles.clear();
|
||||
compilerOptions.clear();
|
||||
defines.clear();
|
||||
|
||||
@@ -70,7 +70,7 @@ class CMAKE_EXPORT CMakeBuildTarget
|
||||
public:
|
||||
QString title;
|
||||
QString executable; // TODO: rename to output?
|
||||
TargetType targetType;
|
||||
TargetType targetType = UtilityType;
|
||||
QString workingDirectory;
|
||||
QString sourceDirectory;
|
||||
QString makeCommand;
|
||||
|
||||
Reference in New Issue
Block a user