aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/generator/main.cpp')
-rw-r--r--sources/shiboken2/generator/main.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/sources/shiboken2/generator/main.cpp b/sources/shiboken2/generator/main.cpp
index b787d9f7e..69f59a1b4 100644
--- a/sources/shiboken2/generator/main.cpp
+++ b/sources/shiboken2/generator/main.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of PySide2.
+** This file is part of Qt for Python.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
@@ -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."));