summaryrefslogtreecommitdiffstats
path: root/src/tools/androiddeployqt
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2021-11-22 19:19:58 +0100
committerAlexey Edelev <alexey.edelev@qt.io>2021-12-02 14:28:09 +0100
commit6b025f9b27293a859519c24861a946197ef9914d (patch)
tree8b8f020ce7b880235d07a16f7b3fe964d1d88c94 /src/tools/androiddeployqt
parent87db26bdfe56e9445c03623eb962f569b2570b92 (diff)
Use depfile to control ABI-specific builds of executable targets
qt_internal_${target}_copy_apk_dependencies should use CMake DEPFILE approach when it's possible. Since we don't have any specific artifact that androiddeployqt can produce when collecting dependencies this change adds simple timestamp file that is touched each time when androiddeployqt is running. The timestamp is used then as a file-level dependency for the qt_internal_${target}_copy_apk_dependencies target. Task-number: QTBUG-88841 Change-Id: I985535c7b6e471cb4cfbf90128628087dadc72d0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/tools/androiddeployqt')
-rw-r--r--src/tools/androiddeployqt/main.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp
index 4e54c41801..8fc3fa8d05 100644
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -3110,12 +3110,19 @@ bool writeDependencyFile(const Options &options)
if (options.verbose)
fprintf(stdout, "Writing dependency file.\n");
- QFile depFile(options.depFilePath);
-
- QString relativeApkPath = QDir(options.buildDirectory).relativeFilePath(options.apkPath);
+ QString relativeTargetPath;
+ if (options.copyDependenciesOnly) {
+ // When androiddeploy Qt is running in copyDependenciesOnly mode we need to use
+ // the timestamp file as the target to collect dependencies.
+ QString timestampAbsPath = QFileInfo(options.depFilePath).absolutePath() + QLatin1String("/timestamp");
+ relativeTargetPath = QDir(options.buildDirectory).relativeFilePath(timestampAbsPath);
+ } else {
+ relativeTargetPath = QDir(options.buildDirectory).relativeFilePath(options.apkPath);
+ }
+ QFile depFile(options.depFilePath);
if (depFile.open(QIODevice::WriteOnly)) {
- depFile.write(escapeAndEncodeDependencyPath(relativeApkPath));
+ depFile.write(escapeAndEncodeDependencyPath(relativeTargetPath));
depFile.write(": ");
for (const auto &file : dependenciesForDepfile) {
@@ -3227,6 +3234,8 @@ int main(int argc, char *argv[])
}
if (options.copyDependenciesOnly) {
+ if (!options.depFilePath.isEmpty())
+ writeDependencyFile(options);
return 0;
}