summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/GenerateExportHeader/libstatic
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-01 19:22:05 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-05 13:45:42 (GMT)
commitfc3dab0ea956db618fe2b77778ac413db846b422 (patch)
treede71447ff4c14e7a2d204ed94445f162a49d9266 /Tests/RunCMake/GenerateExportHeader/libstatic
parent4feba34d02fe42fd20209e5b247f91d8e0f7a2ac (diff)
downloadCMake-fc3dab0ea956db618fe2b77778ac413db846b422.zip
CMake-fc3dab0ea956db618fe2b77778ac413db846b422.tar.gz
CMake-fc3dab0ea956db618fe2b77778ac413db846b422.tar.bz2
Tests: Port GenerateExportHeader test to RunCMake infrastructure
This will allow build failure cases to be added later.
Diffstat (limited to 'Tests/RunCMake/GenerateExportHeader/libstatic')
-rw-r--r--Tests/RunCMake/GenerateExportHeader/libstatic/CMakeLists.txt18
-rw-r--r--Tests/RunCMake/GenerateExportHeader/libstatic/libstatic.cpp97
-rw-r--r--Tests/RunCMake/GenerateExportHeader/libstatic/libstatic.h57
3 files changed, 172 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..b2db3ea
--- /dev/null
+++ b/Tests/RunCMake/GenerateExportHeader/libstatic/CMakeLists.txt
@@ -0,0 +1,18 @@
+
+cmake_minimum_required(VERSION 2.8)
+
+project(libstatic)
+
+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