aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-04-27 09:11:48 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-04-27 08:59:51 +0000
commit4035c45e58896329e5b8b72913ff7f30d387c3dc (patch)
tree82fa75cf1d86cdfb5be7812634c8f8a9252f9069 /sources/shiboken2/generator
parent7803a22eee4ff86741fd4c12f6d4cf859961c273 (diff)
shiboken: Accept relative file name as C++ header
Relative file names cause Clang not to find them since they are included by a temporary header file. Check and convert to an absolute path via QFileInfo. Change-Id: Ie87b4d2a6fcf5d98062a8a40a3eccbbb9513c62e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/generator')
-rw-r--r--sources/shiboken2/generator/main.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/sources/shiboken2/generator/main.cpp b/sources/shiboken2/generator/main.cpp
index b787d9f7e..1447baf2e 100644
--- a/sources/shiboken2/generator/main.cpp
+++ b/sources/shiboken2/generator/main.cpp
@@ -544,6 +544,12 @@ int main(int argc, char *argv[])
}
QString cppFileName = argsHandler.removeArg(QLatin1String("arg-1"));
+ const QFileInfo cppFileNameFi(cppFileName);
+ if (!cppFileNameFi.isFile() && !cppFileNameFi.isSymLink()) {
+ errorPrint(QLatin1Char('"') + cppFileName + QLatin1String("\" does not exist."));
+ return EXIT_FAILURE;
+ }
+
QString typeSystemFileName = argsHandler.removeArg(QLatin1String("arg-2"));
QString messagePrefix = QFileInfo(typeSystemFileName).baseName();
if (messagePrefix.startsWith(QLatin1String("typesystem_")))
@@ -579,7 +585,7 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
}
- extractor.setCppFileName(cppFileName);
+ extractor.setCppFileName(cppFileNameFi.absoluteFilePath());
extractor.setTypeSystem(typeSystemFileName);
if (!extractor.run()) {
errorPrint(QLatin1String("Error running ApiExtractor."));