diff options
author | Raphael Cotty <raphael.cotty@gmail.com> | 2021-10-23 20:38:02 +0200 |
---|---|---|
committer | Raphaƫl Cotty <raphael.cotty@gmail.com> | 2021-10-25 05:15:31 +0000 |
commit | 34233e45f9c3a1273f507395c8675836297fab08 (patch) | |
tree | e260b0d24a795c2fcb58a9f03a82a9b58df28d57 | |
parent | 9680337d438ad6574688286118693049e6caac7e (diff) | |
download | qbs-34233e45f9c3a1273f507395c8675836297fab08.tar.gz |
Android: correct reading of prl files and remove pthread lib
prl files for Qt versions 6.0 and 6.1 don't have an architecture
suffix.
prl files from Qt version 6.0 require pthread in the QMAKE_PRL_LIBS
variable but the pthread functionality is included in the libc on
android.
The issue did not trigger an error before Qt 6.2 because the prl file
was not read.
Change-Id: Ia59d1102d6136aa87bfc17df7c6981048b0d0fca
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
-rw-r--r-- | share/qbs/module-providers/Qt/setup-qt.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/share/qbs/module-providers/Qt/setup-qt.js b/share/qbs/module-providers/Qt/setup-qt.js index 422863b95..5298f8984 100644 --- a/share/qbs/module-providers/Qt/setup-qt.js +++ b/share/qbs/module-providers/Qt/setup-qt.js @@ -701,9 +701,13 @@ function doSetupLibraries(modInfo, qtProps, debugBuild, nonExistingPrlFiles, and && !modInfo.isStaticLibrary && qtProps.qtMajorVersion < 5; if (isNonStaticQt4OnWindows) prlFilePath = prlFilePath.slice(0, prlFilePath.length - 1); // The prl file base name does *not* contain the version number... + // qt for android versions 6.0 and 6.1 don't have the architecture suffix in the prl file if (androidAbi.length > 0 && modInfo.name !== "QtBootstrap" - && modInfo.name !== "QtQmlDevTools") { + && (modInfo.name !== "QtQmlDevTools" || modInfo.name === "QtQmlDevTools" + && Utilities.versionCompare(qtProps.qtVersion, "6.2") >= 0) + && (Utilities.versionCompare(qtProps.qtVersion, "6.0") < 0 + || Utilities.versionCompare(qtProps.qtVersion, "6.2") >= 0)) { prlFilePath += "_"; prlFilePath += androidAbi; } @@ -769,7 +773,10 @@ function doSetupLibraries(modInfo, qtProps, debugBuild, nonExistingPrlFiles, and if (++i < parts.length) frameworks.push(parts[i]); } else if (part === "-pthread") { - libs.push("pthread"); + // prl files for android have QMAKE_PRL_LIBS = -llog -pthread but the pthread + // functionality is included in libc. + if (androidAbi.length === 0) + libs.push("pthread"); } else if (part.startsWith('-')) { // Some other option console.debug("QMAKE_PRL_LIBS contains non-library option '" + part + "' in file '" + prlFilePath + "'"); @@ -786,7 +793,7 @@ function doSetupLibraries(modInfo, qtProps, debugBuild, nonExistingPrlFiles, and if (nonExistingPrlFiles.contains(prlFilePath)) return; nonExistingPrlFiles.push(prlFilePath); - if (!libFilePath && modInfo.mustExist) { + if (modInfo.mustExist) { console.warn("Could not open prl file '" + toNative(prlFilePath) + "' for module '" + modInfo.name + "' (" + e + "), and failed to deduce the library file path. " |