From 37720832aa0212c51cbd60f43dda7dc9a4f2f425 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 25 Sep 2020 10:28:04 +0200 Subject: tst_addresscache: Fix qbs build While we're at it, also consider the ELFUTILS_INSTALL_DIR environment variable. Change-Id: Ifeb5cc7df6e29426633d27a840185ba67ed838b6 Reviewed-by: Ulf Hermann --- app/app.qbs | 3 ++- perfparser.qbs | 10 +++++++++- tests/auto/addresscache/addresscache.qbs | 8 ++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/app/app.qbs b/app/app.qbs index 71eff96..0e11526 100644 --- a/app/app.qbs +++ b/app/app.qbs @@ -9,7 +9,8 @@ QtcTool { Depends { name: "Qt.network" } cpp.defines: base.filter(function(def) { return def != "QT_RESTRICTED_CAST_FROM_ASCII"; }) - cpp.includePaths: ["/usr/include/elfutils"] + cpp.includePaths: project.includePaths + cpp.libraryPaths: project.libPaths cpp.dynamicLibraries: ["dw", "elf"] files: [ diff --git a/perfparser.qbs b/perfparser.qbs index 7b141e7..1f6c05e 100644 --- a/perfparser.qbs +++ b/perfparser.qbs @@ -1,4 +1,5 @@ -import qbs +import qbs.Environment +import qbs.FileInfo Project { name: "Perf Parser" @@ -6,6 +7,13 @@ Project { property bool withAutotests: qbs.buildVariant === "debug" + property string installBase: Environment.getEnv("ELFUTILS_INSTALL_DIR") + property stringList includePaths: installBase + ? [FileInfo.joinPaths(installBase, "include"), + FileInfo.joinPaths(installBase, "include", "elfutils")] + : "/usr/include/elfutils" + property stringList libPaths: installBase ? [FileInfo.joinPaths(installBase, "lib")] : [] + references: [ "app", "tests", diff --git a/tests/auto/addresscache/addresscache.qbs b/tests/auto/addresscache/addresscache.qbs index d234288..9c8d0b3 100644 --- a/tests/auto/addresscache/addresscache.qbs +++ b/tests/auto/addresscache/addresscache.qbs @@ -7,7 +7,11 @@ QtcAutotest { "../../../app/perfelfmap.cpp", "../../../app/perfelfmap.h", "../../../app/perfaddresscache.cpp", - "../../../app/perfaddresscache.h" + "../../../app/perfaddresscache.h", + "../../../app/perfdwarfdiecache.cpp", + "../../../app/perfdwarfdiecache.h", ] - cpp.includePaths: base.concat(["../../../app"]) + cpp.includePaths: base.concat(["../../../app"]).concat(project.includePaths) + cpp.libraryPaths: project.libPaths + cpp.dynamicLibraries: ["dw", "elf"] } -- cgit v1.2.3