diff options
author | Alberto Mardegan <mardy@users.sourceforge.net> | 2019-11-07 20:06:41 +0300 |
---|---|---|
committer | Alberto Mardegan <mardy@users.sourceforge.net> | 2019-11-12 09:32:32 +0000 |
commit | a8bb88572d2f0c39d3841d082cd956593cfe403e (patch) | |
tree | d7c118284a4de5a40b372f6c076f742635ac275b /tests/auto/blackbox/testdata/remove-duplicate-libs/remove-duplicate-libs.qbs | |
parent | faa280045d783d2fbe815fa83c8c143faf02ecf7 (diff) |
GCC: avoid duplicating objects in linker command line
Long command lines are especially a problem when building statically in
MXE. This commit tries to replicate the logic employed by qmake, where
before adding a new object to the command line, all of its previous
appearences get removed.
Fixes: QBS-1273
Change-Id: I51c843c4a7cfc170ed4fab30deae6c4229690dd0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests/auto/blackbox/testdata/remove-duplicate-libs/remove-duplicate-libs.qbs')
-rw-r--r-- | tests/auto/blackbox/testdata/remove-duplicate-libs/remove-duplicate-libs.qbs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/remove-duplicate-libs/remove-duplicate-libs.qbs b/tests/auto/blackbox/testdata/remove-duplicate-libs/remove-duplicate-libs.qbs new file mode 100644 index 000000000..4ffb8d0e2 --- /dev/null +++ b/tests/auto/blackbox/testdata/remove-duplicate-libs/remove-duplicate-libs.qbs @@ -0,0 +1,26 @@ +import "MyStaticLib.qbs" as MyStaticLib + +Project { + property bool removeDuplicates + property string libDir: buildDirectory + "/lib" + property bool dummy: { + console.info("is bfd linker: " + + (qbs.toolchain.contains("gcc") && !qbs.hostOS.contains("macos"))) + } + + qbsSearchPaths: "." + MyStaticLib { name: "requestor1" } + MyStaticLib { name: "requestor2" } + MyStaticLib { name: "provider"; Group { files: "provider2.c" } } + + CppApplication { + consoleApplication: true + Depends { name: "requestor1"; cpp.link: false } + Depends { name: "requestor2"; cpp.link: false } + Depends { name: "provider"; cpp.link: false } + cpp.libraryPaths: project.libDir + cpp.removeDuplicateLibraries: project.removeDuplicates + cpp.staticLibraries: ["requestor1", "requestor2", "provider", "requestor2"] + files: "main.c" + } +} |