summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-07-26 12:03:44 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-07-26 13:15:42 (GMT)
commitc8a10ba9ad8707cfb892ca812efa2f6899adf60b (patch)
tree7ca464085ac64697fe4034344ed9ed0122add251 /Tests
parentf94bdb3deb70d0fa7ed5275609318be8ac79503b (diff)
downloadCMake-c8a10ba9ad8707cfb892ca812efa2f6899adf60b.zip
CMake-c8a10ba9ad8707cfb892ca812efa2f6899adf60b.tar.gz
CMake-c8a10ba9ad8707cfb892ca812efa2f6899adf60b.tar.bz2
cmTarget: Fix iface libraries and languages for static libraries.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt9
-rw-r--r--Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib1.cpp2
-rw-r--r--Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib1.h4
-rw-r--r--Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib2.cpp2
-rw-r--r--Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib2.h4
-rw-r--r--Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib_exe.cpp8
6 files changed, 29 insertions, 0 deletions
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
index dd6ab41..07d7c43 100644
--- a/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
@@ -16,3 +16,12 @@ assert_property(cmp0022ifacelib INTERFACE_LINK_LIBRARIES "")
add_executable(cmp0022exe cmp0022exe.cpp)
target_link_libraries(cmp0022exe cmp0022lib)
+
+add_library(staticlib1 STATIC staticlib1.cpp)
+generate_export_header(staticlib1)
+add_library(staticlib2 STATIC staticlib2.cpp)
+generate_export_header(staticlib2)
+target_link_libraries(staticlib1 LINK_PUBLIC staticlib2)
+
+add_executable(staticlib_exe staticlib_exe.cpp)
+target_link_libraries(staticlib_exe staticlib1)
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib1.cpp b/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib1.cpp
new file mode 100644
index 0000000..a253c46
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib1.cpp
@@ -0,0 +1,2 @@
+
+int staticlib1() { return 0; }
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib1.h b/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib1.h
new file mode 100644
index 0000000..4bbf23f
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib1.h
@@ -0,0 +1,4 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+int staticlib1();
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib2.cpp b/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib2.cpp
new file mode 100644
index 0000000..4e38063
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib2.cpp
@@ -0,0 +1,2 @@
+
+int staticlib2() { return 0; }
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib2.h b/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib2.h
new file mode 100644
index 0000000..a4e07b6
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib2.h
@@ -0,0 +1,4 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+int staticlib2();
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib_exe.cpp b/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib_exe.cpp
new file mode 100644
index 0000000..97adc40
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib_exe.cpp
@@ -0,0 +1,8 @@
+
+#include "staticlib1.h"
+#include "staticlib2.h"
+
+int main()
+{
+ return staticlib1() + staticlib2();
+}