diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-08-22 17:02:41 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-09-04 07:11:56 +0000 |
commit | 909128d2647498b66f4dc6c1e948af6b47d0c42a (patch) | |
tree | 76a28ea633f5ab60f3079c470b793d153449d477 /tests/auto/blackbox/testdata | |
parent | be637305226049fbe4d09a435292c1034ee66312 (diff) |
MSVC: Give hint about possible reason for missing import lib
If an import lib is unexpectedly not present, the reason is usually that
no symbols are exported from the DLL. This is not obvious at all, so
catch this condition and explain what is happening.
Task-number: QBS-1291
Change-Id: Ia2df8e1a27e0231e855413245703ffc05221722e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/blackbox/testdata')
4 files changed, 41 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/no-exported-symbols/lib.cpp b/tests/auto/blackbox/testdata/no-exported-symbols/lib.cpp new file mode 100644 index 000000000..20cfe21da --- /dev/null +++ b/tests/auto/blackbox/testdata/no-exported-symbols/lib.cpp @@ -0,0 +1 @@ +static void someFunc() {} diff --git a/tests/auto/blackbox/testdata/no-exported-symbols/lib.h b/tests/auto/blackbox/testdata/no-exported-symbols/lib.h new file mode 100644 index 000000000..48fa2de97 --- /dev/null +++ b/tests/auto/blackbox/testdata/no-exported-symbols/lib.h @@ -0,0 +1,6 @@ +#ifndef TEST_LIB +#define TEST_LIB + +inline int success() { return 0; } + +#endif diff --git a/tests/auto/blackbox/testdata/no-exported-symbols/main.cpp b/tests/auto/blackbox/testdata/no-exported-symbols/main.cpp new file mode 100644 index 000000000..a76122e19 --- /dev/null +++ b/tests/auto/blackbox/testdata/no-exported-symbols/main.cpp @@ -0,0 +1,6 @@ +#include <lib.h> + +int main() +{ + return success(); +} diff --git a/tests/auto/blackbox/testdata/no-exported-symbols/no-exported-symbols.qbs b/tests/auto/blackbox/testdata/no-exported-symbols/no-exported-symbols.qbs new file mode 100644 index 000000000..4bda00caf --- /dev/null +++ b/tests/auto/blackbox/testdata/no-exported-symbols/no-exported-symbols.qbs @@ -0,0 +1,28 @@ +Project { + DynamicLibrary { + name: "the_lib" + Depends { name: "cpp" } + files: ["lib.cpp", "lib.h"] + Export { + Depends { name: "cpp" } + cpp.includePaths: path + } + + Probe { + id: toolchainProbe + property stringList toolchain: qbs.toolchain + configure: { + if (toolchain.contains("msvc")) + console.info("compiler is MSVC") + else + console.info("compiler is not MSVC") + } + } + } + CppApplication { + name: "the_app" + property bool link + Depends { name: "the_lib"; cpp.link: product.link } + files: "main.cpp" + } +} |