summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-06 14:44:56 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-09-06 14:45:38 (GMT)
commit70a2a5d1e05683c6be70bbedd6f9dd93556bd458 (patch)
tree0ca239bda59380b69ce90d55b605f28af5d0a012 /Tests
parent8362db82ec442195bf361898655a683548a2f023 (diff)
parent94e70e5329e54754820008514a08614577d2f201 (diff)
downloadCMake-70a2a5d1e05683c6be70bbedd6f9dd93556bd458.zip
CMake-70a2a5d1e05683c6be70bbedd6f9dd93556bd458.tar.gz
CMake-70a2a5d1e05683c6be70bbedd6f9dd93556bd458.tar.bz2
Merge topic 'vs-csharp-ref-no-asm'
94e70e53 Merge branch 'backport-vs-csharp-ref-no-asm' into vs-csharp-ref-no-asm 7e57e6ae VS: Do not reference output assemblies if not possible for CSharp target Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1203
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CSharpLinkToCxx/CMakeLists.txt6
-rw-r--r--Tests/CSharpLinkToCxx/cpp_native.cpp10
-rw-r--r--Tests/CSharpLinkToCxx/cpp_native.hpp9
3 files changed, 25 insertions, 0 deletions
diff --git a/Tests/CSharpLinkToCxx/CMakeLists.txt b/Tests/CSharpLinkToCxx/CMakeLists.txt
index c4269e0..153c57c 100644
--- a/Tests/CSharpLinkToCxx/CMakeLists.txt
+++ b/Tests/CSharpLinkToCxx/CMakeLists.txt
@@ -15,3 +15,9 @@ target_compile_options(CLIApp PRIVATE "/clr")
add_executable(CSharpLinkToCxx csharp.cs)
target_link_libraries(CSharpLinkToCxx CLIApp)
+
+# this unmanaged C++ library will be added to the C#/.NET
+# references of CSharpLinkToCxx but it will show a warning
+# because it is unmanaged
+add_library(CppNativeApp SHARED cpp_native.hpp cpp_native.cpp)
+target_link_libraries(CSharpLinkToCxx CppNativeApp)
diff --git a/Tests/CSharpLinkToCxx/cpp_native.cpp b/Tests/CSharpLinkToCxx/cpp_native.cpp
new file mode 100644
index 0000000..dc7670f
--- /dev/null
+++ b/Tests/CSharpLinkToCxx/cpp_native.cpp
@@ -0,0 +1,10 @@
+#include "cpp_native.hpp"
+
+#include <iostream>
+
+namespace CppApp {
+void MyCpp::testMyCpp()
+{
+ std::cout << "#message from CppApp" << std::endl;
+}
+}
diff --git a/Tests/CSharpLinkToCxx/cpp_native.hpp b/Tests/CSharpLinkToCxx/cpp_native.hpp
new file mode 100644
index 0000000..0fa1a3b
--- /dev/null
+++ b/Tests/CSharpLinkToCxx/cpp_native.hpp
@@ -0,0 +1,9 @@
+#pragma once
+
+namespace CppApp {
+class MyCpp
+{
+public:
+ void testMyCpp();
+};
+}