From 8fa110847f7156c994dec9bce09be83ca46c148f Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 27 May 2014 14:17:23 +0200 Subject: Fix "appWithoutSources" blackbox test for Windows. The "main" symbol seems to lose its magic if it comes from a library, so tell the linker where the entry point is. For this purpose, use C instead of C++, so we won't have to deal with name mangling. Change-Id: Ia2c0714431a1b54ebcbba3d13851d4cfcf9a6c3e Reviewed-by: Joerg Bornemann --- tests/auto/blackbox/testdata/appWithoutSources/a.c | 1 + tests/auto/blackbox/testdata/appWithoutSources/a.cpp | 1 - tests/auto/blackbox/testdata/appWithoutSources/b.c | 10 ++++++++++ tests/auto/blackbox/testdata/appWithoutSources/b.cpp | 10 ---------- tests/auto/blackbox/testdata/appWithoutSources/project.qbs | 9 +++++++-- 5 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 tests/auto/blackbox/testdata/appWithoutSources/a.c delete mode 100644 tests/auto/blackbox/testdata/appWithoutSources/a.cpp create mode 100644 tests/auto/blackbox/testdata/appWithoutSources/b.c delete mode 100644 tests/auto/blackbox/testdata/appWithoutSources/b.cpp (limited to 'tests/auto/blackbox') diff --git a/tests/auto/blackbox/testdata/appWithoutSources/a.c b/tests/auto/blackbox/testdata/appWithoutSources/a.c new file mode 100644 index 000000000..bf7759e11 --- /dev/null +++ b/tests/auto/blackbox/testdata/appWithoutSources/a.c @@ -0,0 +1 @@ +int foo() { return 42; } diff --git a/tests/auto/blackbox/testdata/appWithoutSources/a.cpp b/tests/auto/blackbox/testdata/appWithoutSources/a.cpp deleted file mode 100644 index bf7759e11..000000000 --- a/tests/auto/blackbox/testdata/appWithoutSources/a.cpp +++ /dev/null @@ -1 +0,0 @@ -int foo() { return 42; } diff --git a/tests/auto/blackbox/testdata/appWithoutSources/b.c b/tests/auto/blackbox/testdata/appWithoutSources/b.c new file mode 100644 index 000000000..e3841fa32 --- /dev/null +++ b/tests/auto/blackbox/testdata/appWithoutSources/b.c @@ -0,0 +1,10 @@ +#include + +int foo(); // defined in a.cpp + +int main() +{ + printf("The answer is %d.\n", foo()); + return 0; +} + diff --git a/tests/auto/blackbox/testdata/appWithoutSources/b.cpp b/tests/auto/blackbox/testdata/appWithoutSources/b.cpp deleted file mode 100644 index 76c93685d..000000000 --- a/tests/auto/blackbox/testdata/appWithoutSources/b.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include - -int foo(); // defined in a.cpp - -int main() -{ - printf("The answer is %d.\n", foo()); - return 0; -} - diff --git a/tests/auto/blackbox/testdata/appWithoutSources/project.qbs b/tests/auto/blackbox/testdata/appWithoutSources/project.qbs index 983cc9bab..f59d3ad85 100644 --- a/tests/auto/blackbox/testdata/appWithoutSources/project.qbs +++ b/tests/auto/blackbox/testdata/appWithoutSources/project.qbs @@ -7,7 +7,7 @@ Project { Depends { name: "cpp" } files: [ - "a.cpp", + "a.c", ] } @@ -18,12 +18,17 @@ Project { Depends { name: "cpp" } files: [ - "b.cpp", + "b.c", ] } CppApplication { name: "appWithoutSources" + Properties { + condition: qbs.toolchain.contains("msvc") + cpp.linkerFlags: "/ENTRY:main" + } + Depends { name: "a" } Depends { name: "b" } } -- cgit v1.2.3