qbs build: Fix wrong uses of qbs.toolchainType

qbs.toolchainType is a convenience property to *set* the toolchain in a
profile or on the command line. It must not be used to check for the
toolchain.

Change-Id: I97e3a2baceca4233db97f33b9fa8f2bc61abbcf3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2023-09-18 13:59:19 +02:00
parent eec022ac85
commit 88ddecd281
3 changed files with 4 additions and 6 deletions

View File

@@ -8,9 +8,9 @@ QtcLibrary {
var libs = [];
if (qbs.targetOS.contains("windows")) {
libs.push("user32", "iphlpapi", "ws2_32", "shell32", "ole32");
if (qbs.toolchainType === "mingw")
if (qbs.toolchain.contains("mingw"))
libs.push("uuid");
else if (qbs.toolchainType === "msvc")
else if (qbs.toolchain.contains("msvc"))
libs.push("dbghelp");
} else if (qbs.targetOS.contains("unix")) {
if (!qbs.targetOS.contains("macos"))

View File

@@ -11,9 +11,7 @@ QtcTool {
Properties {
condition: qbs.targetOS.contains("windows")
cpp.dynamicLibraries: {
return qbs.toolchainType === "msvc" ? ["user32", "dbghelp"] : ["user32"];
}
cpp.dynamicLibraries: qbs.toolchain.contains("msvc") ? ["user32", "dbghelp"] : ["user32"]
}
files: [

View File

@@ -27,7 +27,7 @@ QtcLibrary {
var libs = [];
if (qbs.targetOS.contains("windows"))
libs.push("user32", "shell32");
if (qbs.toolchainType === "msvc")
if (qbs.toolchain.contains("msvc"))
libs.push("dbghelp");
return libs;
}