aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata/external-libs
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-04-20 12:20:30 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2017-04-21 07:11:29 +0000
commitd50136199ba49ce1a87dffbce2353f8777d592b1 (patch)
treeb966bfbe9765e31babba6195efbe8676df142b5b /tests/auto/blackbox/testdata/external-libs
parentd5542fa418045d5ff7b8a1af33761ee245407841 (diff)
GCC: Do not mess with the list of external libraries
Consider the following: There are external static libraries libA and libB, with libB having a dependency on libA. Some module pulls in libA, another one pulls in libB and libA. The raw contents of cpp.staticLibraries for the product might end up as ["libA","libB","libA"]. Before this patch, our library collection code "simplified" this list to ["libA","libB"], which leads to a linker error. Since we generally do not know about the dependencies of external libraries, we should not touch these lists. Change-Id: I4a94dfc8505ee9ece2562dc3aa3d66244ec7fdac Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/blackbox/testdata/external-libs')
-rw-r--r--tests/auto/blackbox/testdata/external-libs/external-libs.qbs62
-rw-r--r--tests/auto/blackbox/testdata/external-libs/lib1.cpp1
-rw-r--r--tests/auto/blackbox/testdata/external-libs/lib2.cpp3
-rw-r--r--tests/auto/blackbox/testdata/external-libs/main.cpp6
4 files changed, 72 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/external-libs/external-libs.qbs b/tests/auto/blackbox/testdata/external-libs/external-libs.qbs
new file mode 100644
index 000000000..9a5bbdd6b
--- /dev/null
+++ b/tests/auto/blackbox/testdata/external-libs/external-libs.qbs
@@ -0,0 +1,62 @@
+import qbs
+import qbs.TextFile
+
+Project {
+ property string libDir: sourceDirectory + "/libs"
+ StaticLibrary {
+ name: "lib1"
+ destinationDirectory: project.libDir
+ Depends { name: "cpp" }
+ files: ["lib1.cpp"]
+ }
+ StaticLibrary {
+ name: "lib2"
+ destinationDirectory: project.libDir
+ Depends { name: "cpp" }
+ Depends { name: "lib1" }
+ files: ["lib2.cpp"]
+ }
+ // TODO: Remove once we have parameterized dependencies
+ Product {
+ name: "barrier"
+ type: ["blubb"]
+ Depends { name: "lib1" }
+ Depends { name: "lib2" }
+ Rule {
+ multiplex: true
+ inputsFromDependencies: ["staticlibrary"]
+ Artifact {
+ filePath: "dummy"
+ fileTags: ["blubb"]
+ }
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.silent = true;
+ cmd.sourceCode = function() { }
+ return [cmd];
+ }
+ }
+ }
+ CppApplication {
+ Depends { name: "barrier" }
+ files: ["main.cpp"]
+ cpp.libraryPaths: [project.libDir]
+ cpp.staticLibraries: ["lib1", "lib2", "lib1"]
+ Rule {
+ inputsFromDependencies: ["blubb"]
+ Artifact {
+ filePath: "dummy.cpp"
+ fileTags: ["cpp"]
+ }
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.sourceCode = function() {
+ var f = new TextFile(output.filePath, TextFile.WriteOnly);
+ f.writeLine("void dummy() { }");
+ f.close();
+ };
+ return [cmd];
+ }
+ }
+ }
+}
diff --git a/tests/auto/blackbox/testdata/external-libs/lib1.cpp b/tests/auto/blackbox/testdata/external-libs/lib1.cpp
new file mode 100644
index 000000000..bb69fa422
--- /dev/null
+++ b/tests/auto/blackbox/testdata/external-libs/lib1.cpp
@@ -0,0 +1 @@
+void func_lib1() { }
diff --git a/tests/auto/blackbox/testdata/external-libs/lib2.cpp b/tests/auto/blackbox/testdata/external-libs/lib2.cpp
new file mode 100644
index 000000000..e669a7f6c
--- /dev/null
+++ b/tests/auto/blackbox/testdata/external-libs/lib2.cpp
@@ -0,0 +1,3 @@
+void func_lib1();
+
+void func_lib2() { func_lib1(); }
diff --git a/tests/auto/blackbox/testdata/external-libs/main.cpp b/tests/auto/blackbox/testdata/external-libs/main.cpp
new file mode 100644
index 000000000..9a6eab23e
--- /dev/null
+++ b/tests/auto/blackbox/testdata/external-libs/main.cpp
@@ -0,0 +1,6 @@
+void func_lib2();
+
+int main()
+{
+ func_lib2();
+}