summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/GenerateExportHeader/libstatic
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-06 12:51:01 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-09-06 12:51:01 (GMT)
commit9109ba434782a3514f1bc6a5fd3c063d231008f2 (patch)
treedffcad4cce3d78a9c80f6a2d46270ce315a9c26b /Tests/RunCMake/GenerateExportHeader/libstatic
parentcdc911dc53bca22ca56acf2b9a4a0d69e3120c9a (diff)
parent72ecdd34cf6dbec293fe020e1aeed0a17a499061 (diff)
downloadCMake-9109ba434782a3514f1bc6a5fd3c063d231008f2.zip
CMake-9109ba434782a3514f1bc6a5fd3c063d231008f2.tar.gz
CMake-9109ba434782a3514f1bc6a5fd3c063d231008f2.tar.bz2
Merge topic 'test-GenerateExportHeader-with-RunCMake'
72ecdd34 Tests: Cleanup RunCMake.GenerateExportHeader somewhat fc3dab0e Tests: Port GenerateExportHeader test to RunCMake infrastructure 4feba34d GNU: Do not use -fvisibility on AIX or HP-UX
Diffstat (limited to 'Tests/RunCMake/GenerateExportHeader/libstatic')
-rw-r--r--Tests/RunCMake/GenerateExportHeader/libstatic/CMakeLists.txt13
-rw-r--r--Tests/RunCMake/GenerateExportHeader/libstatic/libstatic.cpp97
-rw-r--r--Tests/RunCMake/GenerateExportHeader/libstatic/libstatic.h57
3 files changed, 167 insertions, 0 deletions
diff --git a/Tests/RunCMake/GenerateExportHeader/libstatic/CMakeLists.txt b/Tests/RunCMake/GenerateExportHeader/libstatic/CMakeLists.txt
new file mode 100644
index 0000000..0fd136c
--- /dev/null
+++ b/Tests/RunCMake/GenerateExportHeader/libstatic/CMakeLists.txt
@@ -0,0 +1,13 @@
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+include(GenerateExportHeader)
+
+add_compiler_export_flags()
+
+# Show that the export header has no effect on a static library.
+
+add_library(libstatic STATIC libstatic.cpp)
+
+generate_export_header(libstatic)
+
+export(TARGETS libstatic FILE Targets.cmake)
diff --git a/Tests/RunCMake/GenerateExportHeader/libstatic/libstatic.cpp b/Tests/RunCMake/GenerateExportHeader/libstatic/libstatic.cpp
new file mode 100644
index 0000000..89381af
--- /dev/null
+++ b/Tests/RunCMake/GenerateExportHeader/libstatic/libstatic.cpp
@@ -0,0 +1,97 @@
+
+#include "libstatic.h"
+
+int Libstatic::libstatic() const
+{
+ return 0;
+}
+
+int Libstatic::libstatic_exported() const
+{
+ return 0;
+}
+
+int Libstatic::libstatic_deprecated() const
+{
+ return 0;
+}
+
+int Libstatic::libstatic_not_exported() const
+{
+ return 0;
+}
+
+int Libstatic::libstatic_excluded() const
+{
+ return 0;
+}
+
+int LibstaticNotExported::libstatic() const
+{
+ return 0;
+}
+
+int LibstaticNotExported::libstatic_exported() const
+{
+ return 0;
+}
+
+int LibstaticNotExported::libstatic_deprecated() const
+{
+ return 0;
+}
+
+int LibstaticNotExported::libstatic_not_exported() const
+{
+ return 0;
+}
+
+int LibstaticNotExported::libstatic_excluded() const
+{
+ return 0;
+}
+
+int LibstaticExcluded::libstatic() const
+{
+ return 0;
+}
+
+int LibstaticExcluded::libstatic_exported() const
+{
+ return 0;
+}
+
+int LibstaticExcluded::libstatic_deprecated() const
+{
+ return 0;
+}
+
+int LibstaticExcluded::libstatic_not_exported() const
+{
+ return 0;
+}
+
+int LibstaticExcluded::libstatic_excluded() const
+{
+ return 0;
+}
+
+int libstatic_exported()
+{
+ return 0;
+}
+
+int libstatic_deprecated()
+{
+ return 0;
+}
+
+int libstatic_not_exported()
+{
+ return 0;
+}
+
+int libstatic_excluded()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/GenerateExportHeader/libstatic/libstatic.h b/Tests/RunCMake/GenerateExportHeader/libstatic/libstatic.h
new file mode 100644
index 0000000..6072d9b
--- /dev/null
+++ b/Tests/RunCMake/GenerateExportHeader/libstatic/libstatic.h
@@ -0,0 +1,57 @@
+
+#ifndef LIBSTATIC_H
+#define LIBSTATIC_H
+
+#include "libstatic_export.h"
+
+class LIBSTATIC_EXPORT Libstatic
+{
+public:
+ int libstatic() const;
+
+ int libstatic_exported() const;
+
+ int LIBSTATIC_DEPRECATED libstatic_deprecated() const;
+
+ int libstatic_not_exported() const;
+
+ int LIBSTATIC_NO_EXPORT libstatic_excluded() const;
+};
+
+class LibstaticNotExported
+{
+public:
+ int libstatic() const;
+
+ int LIBSTATIC_EXPORT libstatic_exported() const;
+
+ int LIBSTATIC_DEPRECATED libstatic_deprecated() const;
+
+ int libstatic_not_exported() const;
+
+ int LIBSTATIC_NO_EXPORT libstatic_excluded() const;
+};
+
+class LIBSTATIC_NO_EXPORT LibstaticExcluded
+{
+public:
+ int libstatic() const;
+
+ int LIBSTATIC_EXPORT libstatic_exported() const;
+
+ int LIBSTATIC_DEPRECATED libstatic_deprecated() const;
+
+ int libstatic_not_exported() const;
+
+ int LIBSTATIC_NO_EXPORT libstatic_excluded() const;
+};
+
+LIBSTATIC_EXPORT int libstatic_exported();
+
+LIBSTATIC_DEPRECATED_EXPORT int libstatic_deprecated();
+
+int libstatic_not_exported();
+
+int LIBSTATIC_NO_EXPORT libstatic_excluded();
+
+#endif