Skip to content

Commit 02d6749

Browse files
committed
Qbs: Use pkg-config to depend on zlib
This way we should support building Tiled with zlib in some strange location, like on NixOS. To support this on the latest version of Qbs, we need to set Project.qbsModuleProviders since it no longer falls back on pkg-config by default. Since this property was introduced in Qbs 1.21, this becomes the minimum Qbs version.
1 parent ee52b20 commit 02d6749

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/libtiled/libtiled.qbs

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ DynamicLibrary {
66

77
Depends { name: "cpp" }
88
Depends { name: "Qt"; submodules: "gui"; versionAtLeast: "5.12" }
9+
Depends {
10+
condition: !qbs.toolchain.contains("msvc")
11+
name: "zlib"
12+
}
913

1014
Probes.PkgConfigProbe {
1115
id: pkgConfigZstd
@@ -46,9 +50,6 @@ DynamicLibrary {
4650
cpp.dynamicLibraries: {
4751
var libs = base;
4852

49-
if (!qbs.toolchain.contains("msvc"))
50-
libs.push("z");
51-
5253
if (pkgConfigZstd.found && !project.staticZstd)
5354
libs = libs.concat(pkgConfigZstd.libraries);
5455

tiled.qbs

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import qbs.Environment
33
Project {
44
name: "Tiled"
55

6-
qbsSearchPaths: "qbs"
7-
minimumQbsVersion: "1.13"
6+
minimumQbsVersion: "1.21"
7+
8+
qbsModuleProviders: ["Qt", "qbspkgconfig"]
9+
qbsSearchPaths: ["qbs"]
810

911
property string version: Environment.getEnv("TILED_VERSION") || "1.11.0";
1012
property bool snapshot: Environment.getEnv("TILED_SNAPSHOT") == "true"

0 commit comments

Comments
 (0)