summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ObjectLibrary/exe.c
diff options
context:
space:
mode:
authorDeniz Bahadir <dbahadir@benocs.com>2017-11-24 16:20:18 (GMT)
committerBrad King <brad.king@kitware.com>2018-03-01 14:24:24 (GMT)
commitdfb6e84082884f908ffad4594d2712d9edfd2cc0 (patch)
treed553ea3a982588c523bc34115f19cbeebe34a74c /Tests/RunCMake/ObjectLibrary/exe.c
parent51249e69eaab33fe43805b9fe2262b4ddab01b56 (diff)
downloadCMake-dfb6e84082884f908ffad4594d2712d9edfd2cc0.zip
CMake-dfb6e84082884f908ffad4594d2712d9edfd2cc0.tar.gz
CMake-dfb6e84082884f908ffad4594d2712d9edfd2cc0.tar.bz2
objlib: Allow other libraries to link to `OBJECT` libraries.
Note: This only allows `OBJECT` libraries to be on the right-hand side of `target_link_libraries` but still does not link its object-files to the target on the left-hand side. Issue: #14778
Diffstat (limited to 'Tests/RunCMake/ObjectLibrary/exe.c')
-rw-r--r--Tests/RunCMake/ObjectLibrary/exe.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/ObjectLibrary/exe.c b/Tests/RunCMake/ObjectLibrary/exe.c
new file mode 100644
index 0000000..6efdae7
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/exe.c
@@ -0,0 +1,14 @@
+#if defined(_WIN32) && defined(COMPILE_FOR_SHARED_LIB)
+#define IMPORT __declspec(dllimport)
+#else
+#define IMPORT
+#endif
+
+extern IMPORT int b(void);
+int main()
+{
+ return b();
+}
+#ifndef REQUIRED
+#error "REQUIRED needs to be defined"
+#endif