aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/language/evaluatorscriptclass.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-12-13 15:32:32 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2017-12-13 17:05:09 +0000
commit73f5d22f936570cfb741d5b00d48cf7540c8f816 (patch)
treecb4c1577e0c18484206fb98cd7c5d1ca58b8e40a /src/lib/corelib/language/evaluatorscriptclass.cpp
parenta04af57252c7a858b7920166be32ad9b5773dbd7 (diff)
Fix regression resolving exported paths defined in the exporting product
Commit aa1c500411 inadvertently changed the behavior for cases like this: DynamicLibrary { property path inclPath: "." Export { cpp.includePaths: [product.inclPath] } } Before that patch, the base dir for resolving the include path was the exporting product, afterwards it was the importing one. This patch restores the original behavior, which is the intended one. Change-Id: I8a56cff1163e7fc87361b5ab5e9cbd527b53b79b Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/lib/corelib/language/evaluatorscriptclass.cpp')
-rw-r--r--src/lib/corelib/language/evaluatorscriptclass.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/corelib/language/evaluatorscriptclass.cpp b/src/lib/corelib/language/evaluatorscriptclass.cpp
index be99a53a2..0d0b5e654 100644
--- a/src/lib/corelib/language/evaluatorscriptclass.cpp
+++ b/src/lib/corelib/language/evaluatorscriptclass.cpp
@@ -480,6 +480,12 @@ static void convertToPropertyType(const QString &pathPropertiesBaseDir, const It
if (v.isUndefined() || v.isError())
return;
QString srcDir;
+ QString actualBaseDir;
+ if (!pathPropertiesBaseDir.isEmpty()) {
+ const VariantValueConstPtr itemSourceDir
+ = item->variantProperty(QLatin1String("sourceDirectory"));
+ actualBaseDir = itemSourceDir ? itemSourceDir->value().toString() : pathPropertiesBaseDir;
+ }
const CodeLocation &location = value->location();
switch (decl.type()) {
case PropertyDeclaration::UnknownType:
@@ -499,7 +505,7 @@ static void convertToPropertyType(const QString &pathPropertiesBaseDir, const It
makeTypeError(decl, location, v);
break;
}
- const QString srcDir = overriddenSourceDirectory(item, pathPropertiesBaseDir);
+ const QString srcDir = overriddenSourceDirectory(item, actualBaseDir);
if (!srcDir.isEmpty())
v = v.engine()->toScriptValue(QDir::cleanPath(
FileInfo::resolvePath(srcDir, v.toString())));
@@ -510,7 +516,7 @@ static void convertToPropertyType(const QString &pathPropertiesBaseDir, const It
makeTypeError(decl, location, v);
break;
case PropertyDeclaration::PathList:
- srcDir = overriddenSourceDirectory(item, pathPropertiesBaseDir);
+ srcDir = overriddenSourceDirectory(item, actualBaseDir);
// Fall-through.
case PropertyDeclaration::StringList:
{