summaryrefslogtreecommitdiffstats
path: root/test cases/common/256 subproject extracted objects/subprojects/myobjects
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/common/256 subproject extracted objects/subprojects/myobjects')
-rw-r--r--test cases/common/256 subproject extracted objects/subprojects/myobjects/cpplib.cpp6
-rw-r--r--test cases/common/256 subproject extracted objects/subprojects/myobjects/cpplib.h12
-rw-r--r--test cases/common/256 subproject extracted objects/subprojects/myobjects/meson.build3
3 files changed, 21 insertions, 0 deletions
diff --git a/test cases/common/256 subproject extracted objects/subprojects/myobjects/cpplib.cpp b/test cases/common/256 subproject extracted objects/subprojects/myobjects/cpplib.cpp
new file mode 100644
index 0000000..12ef756
--- /dev/null
+++ b/test cases/common/256 subproject extracted objects/subprojects/myobjects/cpplib.cpp
@@ -0,0 +1,6 @@
+#define BUILDING_DLL
+#include "cpplib.h"
+
+extern "C" int DLL_PUBLIC cppfunc(void) {
+ return 42;
+}
diff --git a/test cases/common/256 subproject extracted objects/subprojects/myobjects/cpplib.h b/test cases/common/256 subproject extracted objects/subprojects/myobjects/cpplib.h
new file mode 100644
index 0000000..a1c38b3
--- /dev/null
+++ b/test cases/common/256 subproject extracted objects/subprojects/myobjects/cpplib.h
@@ -0,0 +1,12 @@
+/* See http://gcc.gnu.org/wiki/Visibility#How_to_use_the_new_C.2B-.2B-_visibility_support */
+#if defined(_WIN32) || defined(__CYGWIN__)
+ #ifdef BUILDING_DLL
+ #define DLL_PUBLIC __declspec(dllexport)
+ #else
+ #define DLL_PUBLIC __declspec(dllimport)
+ #endif
+#else
+ #define DLL_PUBLIC __attribute__ ((visibility ("default")))
+#endif
+
+extern "C" int DLL_PUBLIC cppfunc(void);
diff --git a/test cases/common/256 subproject extracted objects/subprojects/myobjects/meson.build b/test cases/common/256 subproject extracted objects/subprojects/myobjects/meson.build
new file mode 100644
index 0000000..1c2729b
--- /dev/null
+++ b/test cases/common/256 subproject extracted objects/subprojects/myobjects/meson.build
@@ -0,0 +1,3 @@
+project('myobjects', 'cpp')
+
+sublib = static_library('sublib', 'cpplib.cpp')