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>()
<< ApplicationTemplate
<< LibraryTemplate
<< SharedLibraryTemplate
<< AuxTemplate);
if (mode == AutoCreate)
nodes = QmakeProject::nodesWithQtcRunnable(nodes);

View File

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

View File

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

View File

@@ -917,7 +917,8 @@ QList<ProjectAction> QmakePriFileNode::supportedActions(Node *node) const
switch (proFileNode->projectType()) {
case ApplicationTemplate:
case LibraryTemplate:
case StaticLibraryTemplate:
case SharedLibraryTemplate:
case AuxTemplate: {
// 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
@@ -1495,8 +1496,10 @@ static QmakeProjectType proFileTemplateTypeToProjectType(ProFileEvaluator::Templ
case ProFileEvaluator::TT_Unknown:
case ProFileEvaluator::TT_Application:
return ApplicationTemplate;
case ProFileEvaluator::TT_Library:
return LibraryTemplate;
case ProFileEvaluator::TT_StaticLibrary:
return StaticLibraryTemplate;
case ProFileEvaluator::TT_SharedLibrary:
return SharedLibraryTemplate;
case ProFileEvaluator::TT_Script:
return ScriptTemplate;
case ProFileEvaluator::TT_Aux:
@@ -1639,7 +1642,7 @@ FolderNode::AddNewInformation QmakeProFileNode::addNewInformation(const QStringL
bool QmakeProFileNode::showInSimpleTree(QmakeProjectType projectType) const
{
return (projectType == ApplicationTemplate || projectType == LibraryTemplate);
return (projectType == ApplicationTemplate || projectType == SharedLibraryTemplate || projectType == StaticLibraryTemplate);
}
bool QmakeProFileNode::isDebugAndRelease() const
@@ -2512,7 +2515,9 @@ void QmakeProFileNode::updateUiFiles(const QString &buildDir)
m_uiFiles.clear();
// 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
FindUiFileNodesVisitor uiFilesVisitor;
this->accept(&uiFilesVisitor);

View File

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

View File

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

View File

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

View File

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