1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
--- buildtools/qmake/scope.cpp 2007/10/07 14:39:48 722530
+++ buildtools/qmake/scope.cpp 2007/10/11 19:48:00 724231
@@ -325,13 +325,13 @@
return result;
}
-void Scope::calcValuesFromStatements( const QString& variable, QStringList& result, bool checkIncParent, QMake::AST* stopHere, bool fetchFromParent ) const
+void Scope::calcValuesFromStatements( const QString& variable, QStringList& result, bool checkIncParent, QMake::AST* stopHere, bool fetchFromParent, bool setDefault ) const
{
if( !m_root )
return;
/* For variables that we don't know and which are not QT/CONFIG find the default value */
- if( m_defaultopts
+ if( setDefault && m_defaultopts
&& m_defaultopts->variables().findIndex(variable) != -1
&& ( variable == "TEMPLATE" || variable == "QT" || KnownVariables.findIndex(variable) == -1 || variable == "CONFIG" ) )
{
@@ -379,6 +379,42 @@
}
}
}
+ }else if( ast->nodeType() == QMake::AST::IncludeAST )
+ {
+ QMake::IncludeAST* iast = static_cast<QMake::IncludeAST*>(ast);
+ QValueList<unsigned int> l = m_scopes.keys();
+ for( unsigned int i = 0; i < l.count(); ++i )
+ {
+ int num = l[ i ];
+ if( m_scopes.contains( num ) )
+ {
+ Scope* s = m_scopes[num];
+ if( s && s->scopeType() == IncludeScope && s->m_incast == iast )
+ {
+ s->calcValuesFromStatements( variable, result, false, 0, false, false );
+ }
+ }
+ }
+
+ }else if( ast->nodeType() == QMake::AST::ProjectAST )
+ {
+ QMake::ProjectAST* past = static_cast<QMake::ProjectAST*>(ast);
+ if( past->isFunctionScope() || past->isScope() )
+ {
+ QValueList<unsigned int> l = m_scopes.keys();
+ for( unsigned int i = 0; i < l.count(); ++i )
+ {
+ int num = l[ i ];
+ if( m_scopes.contains( num ) )
+ {
+ Scope* s = m_scopes[num];
+ if( s && s->m_root == past && s->m_root->scopedID == past->scopedID )
+ {
+ s->calcValuesFromStatements( variable, result, false, 0, false, false );
+ }
+ }
+ }
+ }
}
}
--- buildtools/qmake/scope.h 2007/10/07 14:39:48 722530
+++ buildtools/qmake/scope.h 2007/10/11 19:48:00 724231
@@ -217,7 +217,7 @@
// runs through the statements until stopHere is found (or the end is reached, if stopHere is 0),
// using the given list as startvalue
// Changes the list using the +=, -=, = operations accordingly
- void calcValuesFromStatements( const QString& variable, QStringList& result, bool, QMake::AST* stopHere = 0, bool fetchFromParent = true ) const;
+ void calcValuesFromStatements( const QString& variable, QStringList& result, bool, QMake::AST* stopHere = 0, bool fetchFromParent = true, bool setDefault = true ) const;
// Check wether the two operators are compatible
static bool isCompatible( const QString& op1, const QString& op2);
@@ -255,8 +255,6 @@
QString replaceWs(QString);
- // All different subscopes of this scope, the key is the "position" at which the scope starts
- QMap<QString, Scope*> m_subProjects;
// The "position" inside the parent scope that this scope starts at
unsigned int m_num;
|