Don't allow to run static libs.

Static libs can't be run on Android and on iOS, so we need to filter
them out.

Change-Id: I90b778ffaa5e7d6267cc0e8d753be56bf93007a7
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
BogDan Vatra
2015-03-17 11:39:48 +02:00
parent 669d9ede54
commit 7481bff2b4
8 changed files with 22 additions and 14 deletions

View File

@@ -101,7 +101,7 @@ QList<Core::Id> IosRunConfigurationFactory::availableCreationIds(Target *parent,
QList<QmakeProFileNode *> nodes = project->allProFiles(QList<QmakeProjectType>() QList<QmakeProFileNode *> nodes = project->allProFiles(QList<QmakeProjectType>()
<< ApplicationTemplate << ApplicationTemplate
<< LibraryTemplate << SharedLibraryTemplate
<< AuxTemplate); << AuxTemplate);
if (mode == AutoCreate) if (mode == AutoCreate)
nodes = QmakeProject::nodesWithQtcRunnable(nodes); nodes = QmakeProject::nodesWithQtcRunnable(nodes);

View File

@@ -92,7 +92,7 @@ QList<Core::Id> QmakeAndroidRunConfigurationFactory::availableCreationIds(Target
QmakeProject *project = static_cast<QmakeProject *>(parent->project()); QmakeProject *project = static_cast<QmakeProject *>(parent->project());
QList<QmakeProFileNode *> nodes = project->allProFiles(QList<QmakeProjectType>() QList<QmakeProFileNode *> nodes = project->allProFiles(QList<QmakeProjectType>()
<< ApplicationTemplate << ApplicationTemplate
<< LibraryTemplate); << SharedLibraryTemplate);
if (mode == AutoCreate) if (mode == AutoCreate)
nodes = QmakeProject::nodesWithQtcRunnable(nodes); nodes = QmakeProject::nodesWithQtcRunnable(nodes);

View File

@@ -1048,7 +1048,7 @@ void InternalLibraryDetailsController::updateProFile()
QList<QmakeProFileNode *> proFiles = findQt4ProFiles(rootProject); QList<QmakeProFileNode *> proFiles = findQt4ProFiles(rootProject);
foreach (QmakeProFileNode *proFileNode, proFiles) { foreach (QmakeProFileNode *proFileNode, proFiles) {
const QString proFilePath = proFileNode->path().toString(); const QString proFilePath = proFileNode->path().toString();
if (proFileNode->projectType() == LibraryTemplate) { if (proFileNode->projectType() == SharedLibraryTemplate) {
const QStringList configVar = proFileNode->variableValue(ConfigVar); const QStringList configVar = proFileNode->variableValue(ConfigVar);
if (!configVar.contains(QLatin1String("plugin"))) { if (!configVar.contains(QLatin1String("plugin"))) {
const QString relProFilePath = rootDir.relativeFilePath(proFilePath); const QString relProFilePath = rootDir.relativeFilePath(proFilePath);

View File

@@ -917,7 +917,8 @@ QList<ProjectAction> QmakePriFileNode::supportedActions(Node *node) const
switch (proFileNode->projectType()) { switch (proFileNode->projectType()) {
case ApplicationTemplate: case ApplicationTemplate:
case LibraryTemplate: case StaticLibraryTemplate:
case SharedLibraryTemplate:
case AuxTemplate: { case AuxTemplate: {
// TODO: Some of the file types don't make much sense for aux // TODO: Some of the file types don't make much sense for aux
// projects (e.g. cpp). It'd be nice if the "add" action could // projects (e.g. cpp). It'd be nice if the "add" action could
@@ -1495,8 +1496,10 @@ static QmakeProjectType proFileTemplateTypeToProjectType(ProFileEvaluator::Templ
case ProFileEvaluator::TT_Unknown: case ProFileEvaluator::TT_Unknown:
case ProFileEvaluator::TT_Application: case ProFileEvaluator::TT_Application:
return ApplicationTemplate; return ApplicationTemplate;
case ProFileEvaluator::TT_Library: case ProFileEvaluator::TT_StaticLibrary:
return LibraryTemplate; return StaticLibraryTemplate;
case ProFileEvaluator::TT_SharedLibrary:
return SharedLibraryTemplate;
case ProFileEvaluator::TT_Script: case ProFileEvaluator::TT_Script:
return ScriptTemplate; return ScriptTemplate;
case ProFileEvaluator::TT_Aux: case ProFileEvaluator::TT_Aux:
@@ -1639,7 +1642,7 @@ FolderNode::AddNewInformation QmakeProFileNode::addNewInformation(const QStringL
bool QmakeProFileNode::showInSimpleTree(QmakeProjectType projectType) const bool QmakeProFileNode::showInSimpleTree(QmakeProjectType projectType) const
{ {
return (projectType == ApplicationTemplate || projectType == LibraryTemplate); return (projectType == ApplicationTemplate || projectType == SharedLibraryTemplate || projectType == StaticLibraryTemplate);
} }
bool QmakeProFileNode::isDebugAndRelease() const bool QmakeProFileNode::isDebugAndRelease() const
@@ -2512,7 +2515,9 @@ void QmakeProFileNode::updateUiFiles(const QString &buildDir)
m_uiFiles.clear(); m_uiFiles.clear();
// Only those two project types can have ui files for us // Only those two project types can have ui files for us
if (m_projectType == ApplicationTemplate || m_projectType == LibraryTemplate) { if (m_projectType == ApplicationTemplate ||
m_projectType == SharedLibraryTemplate ||
m_projectType == StaticLibraryTemplate) {
// Find all ui files // Find all ui files
FindUiFileNodesVisitor uiFilesVisitor; FindUiFileNodesVisitor uiFilesVisitor;
this->accept(&uiFilesVisitor); this->accept(&uiFilesVisitor);

View File

@@ -72,7 +72,8 @@ class QmakeProject;
enum QmakeProjectType { enum QmakeProjectType {
InvalidProject = 0, InvalidProject = 0,
ApplicationTemplate, ApplicationTemplate,
LibraryTemplate, StaticLibraryTemplate,
SharedLibraryTemplate,
ScriptTemplate, ScriptTemplate,
AuxTemplate, AuxTemplate,
SubDirsTemplate SubDirsTemplate

View File

@@ -1492,7 +1492,8 @@ void QmakeProject::collectData(const QmakeProFileNode *node, DeploymentData &dep
if (!installsList.targetPath.isEmpty()) if (!installsList.targetPath.isEmpty())
collectApplicationData(node, deploymentData); collectApplicationData(node, deploymentData);
break; break;
case LibraryTemplate: case SharedLibraryTemplate:
case StaticLibraryTemplate:
collectLibraryData(node, deploymentData); collectLibraryData(node, deploymentData);
break; break;
case SubDirsTemplate: case SubDirsTemplate:

View File

@@ -175,7 +175,7 @@ ProFileEvaluator::TemplateType ProFileEvaluator::templateType() const
if (!t.compare(QLatin1String("app"), Qt::CaseInsensitive)) if (!t.compare(QLatin1String("app"), Qt::CaseInsensitive))
return TT_Application; return TT_Application;
if (!t.compare(QLatin1String("lib"), Qt::CaseInsensitive)) if (!t.compare(QLatin1String("lib"), Qt::CaseInsensitive))
return TT_Library; return d->isActiveConfig(QStringLiteral("staticlib")) ? TT_StaticLibrary : TT_SharedLibrary;
if (!t.compare(QLatin1String("script"), Qt::CaseInsensitive)) if (!t.compare(QLatin1String("script"), Qt::CaseInsensitive))
return TT_Script; return TT_Script;
if (!t.compare(QLatin1String("aux"), Qt::CaseInsensitive)) if (!t.compare(QLatin1String("aux"), Qt::CaseInsensitive))
@@ -220,8 +220,8 @@ bool ProFileEvaluator::accept(ProFile *pro, QMakeEvaluator::LoadFlags flags)
case TT_Application: case TT_Application:
cxxflags += d->values(ProKey("QMAKE_CXXFLAGS_APP")); cxxflags += d->values(ProKey("QMAKE_CXXFLAGS_APP"));
break; break;
case TT_Library: case TT_SharedLibrary:
if (d->isActiveConfig(QStringLiteral("dll"))) { {
bool plugin = d->isActiveConfig(QStringLiteral("plugin")); bool plugin = d->isActiveConfig(QStringLiteral("plugin"));
if (!plugin || !d->isActiveConfig(QStringLiteral("plugin_no_share_shlib_cflags"))) if (!plugin || !d->isActiveConfig(QStringLiteral("plugin_no_share_shlib_cflags")))
cxxflags += d->values(ProKey("QMAKE_CXXFLAGS_SHLIB")); cxxflags += d->values(ProKey("QMAKE_CXXFLAGS_SHLIB"));

View File

@@ -58,7 +58,8 @@ public:
enum TemplateType { enum TemplateType {
TT_Unknown = 0, TT_Unknown = 0,
TT_Application, TT_Application,
TT_Library, TT_StaticLibrary,
TT_SharedLibrary,
TT_Script, TT_Script,
TT_Aux, TT_Aux,
TT_Subdirs TT_Subdirs