summaryrefslogtreecommitdiffstats
path: root/test cases/cmake/6 object library no dep/subprojects
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:41:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:41:38 +0000
commit7b6e527f440cd7e6f8be2b07cee320ee6ca18786 (patch)
tree4a2738d69fa2814659fdadddf5826282e73d81f4 /test cases/cmake/6 object library no dep/subprojects
parentInitial commit. (diff)
downloadmeson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.tar.xz
meson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.zip
Adding upstream version 1.0.1.upstream/1.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test cases/cmake/6 object library no dep/subprojects')
-rw-r--r--test cases/cmake/6 object library no dep/subprojects/cmObjLib/CMakeLists.txt6
-rw-r--r--test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.cpp5
-rw-r--r--test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.hpp16
-rw-r--r--test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.cpp5
-rw-r--r--test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.hpp16
5 files changed, 48 insertions, 0 deletions
diff --git a/test cases/cmake/6 object library no dep/subprojects/cmObjLib/CMakeLists.txt b/test cases/cmake/6 object library no dep/subprojects/cmObjLib/CMakeLists.txt
new file mode 100644
index 0000000..9e136af
--- /dev/null
+++ b/test cases/cmake/6 object library no dep/subprojects/cmObjLib/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.7)
+project(cmObject CXX)
+
+add_library(lib_obj OBJECT libA.cpp libB.cpp)
+add_library(lib_sha SHARED $<TARGET_OBJECTS:lib_obj>)
+add_library(lib_sta STATIC $<TARGET_OBJECTS:lib_obj>)
diff --git a/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.cpp b/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.cpp
new file mode 100644
index 0000000..1d579cf
--- /dev/null
+++ b/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.cpp
@@ -0,0 +1,5 @@
+#include "libA.hpp"
+
+std::string getLibStr(void) {
+ return "Hello World";
+}
diff --git a/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.hpp b/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.hpp
new file mode 100644
index 0000000..84b7bc7
--- /dev/null
+++ b/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.hpp
@@ -0,0 +1,16 @@
+#pragma once
+
+#include <string>
+
+#if defined _WIN32 || defined __CYGWIN__
+ #define DLL_PUBLIC __declspec(dllexport)
+#else
+ #if defined __GNUC__
+ #define DLL_PUBLIC __attribute__ ((visibility("default")))
+ #else
+ #pragma message ("Compiler does not support symbol visibility.")
+ #define DLL_PUBLIC
+ #endif
+#endif
+
+std::string DLL_PUBLIC getLibStr();
diff --git a/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.cpp b/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.cpp
new file mode 100644
index 0000000..aa44816
--- /dev/null
+++ b/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.cpp
@@ -0,0 +1,5 @@
+#include "libB.hpp"
+
+std::string getZlibVers(void) {
+ return "STUB";
+}
diff --git a/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.hpp b/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.hpp
new file mode 100644
index 0000000..52ccc16
--- /dev/null
+++ b/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.hpp
@@ -0,0 +1,16 @@
+#pragma once
+
+#include <string>
+
+#if defined _WIN32 || defined __CYGWIN__
+ #define DLL_PUBLIC __declspec(dllexport)
+#else
+ #if defined __GNUC__
+ #define DLL_PUBLIC __attribute__ ((visibility("default")))
+ #else
+ #pragma message ("Compiler does not support symbol visibility.")
+ #define DLL_PUBLIC
+ #endif
+#endif
+
+std::string DLL_PUBLIC getZlibVers();