summaryrefslogtreecommitdiffstats
path: root/Tests/VSWinStorePhone/WinRT
diff options
context:
space:
mode:
authorGilles Khouzam <gillesk@microsoft.com>2019-02-01 17:40:58 (GMT)
committerBrad King <brad.king@kitware.com>2019-02-01 18:04:52 (GMT)
commitcff026dbc01f975857236a11fc033af48b5e130a (patch)
treeb9d95dad15a93df1bc6f41084731451893c88a6e /Tests/VSWinStorePhone/WinRT
parent6c21722adbc1745b6362ca9501692805c19eb8ac (diff)
downloadCMake-cff026dbc01f975857236a11fc033af48b5e130a.zip
CMake-cff026dbc01f975857236a11fc033af48b5e130a.tar.gz
CMake-cff026dbc01f975857236a11fc033af48b5e130a.tar.bz2
VS: Fix WinRT component references
WinRT components need to be referenced in a similar way that managed code libraries are referenced. Validate that the library reference is a WinRT component and reference it through the project. Add test coverage for `VS_WINRT_COMPONENT`. While at it, fix the IOT reference failing on Win10 SDK 17763 which doesn't include it anymore. Fixes: #18846
Diffstat (limited to 'Tests/VSWinStorePhone/WinRT')
-rw-r--r--Tests/VSWinStorePhone/WinRT/Batman.cpp14
-rw-r--r--Tests/VSWinStorePhone/WinRT/Batman.h12
-rw-r--r--Tests/VSWinStorePhone/WinRT/CMakeLists.txt13
3 files changed, 39 insertions, 0 deletions
diff --git a/Tests/VSWinStorePhone/WinRT/Batman.cpp b/Tests/VSWinStorePhone/WinRT/Batman.cpp
new file mode 100644
index 0000000..e092258
--- /dev/null
+++ b/Tests/VSWinStorePhone/WinRT/Batman.cpp
@@ -0,0 +1,14 @@
+#include "Batman.h"
+
+using namespace JusticeLeagueWinRT;
+using namespace Platform;
+
+Batman::Batman()
+{
+}
+
+void Batman::savePeople()
+{
+ int i = 0;
+ i++;
+}
diff --git a/Tests/VSWinStorePhone/WinRT/Batman.h b/Tests/VSWinStorePhone/WinRT/Batman.h
new file mode 100644
index 0000000..e2dcabc
--- /dev/null
+++ b/Tests/VSWinStorePhone/WinRT/Batman.h
@@ -0,0 +1,12 @@
+#pragma once
+
+namespace JusticeLeagueWinRT {
+public
+ref class Batman sealed
+{
+public:
+ Batman();
+
+ void savePeople();
+};
+}
diff --git a/Tests/VSWinStorePhone/WinRT/CMakeLists.txt b/Tests/VSWinStorePhone/WinRT/CMakeLists.txt
new file mode 100644
index 0000000..bb93333
--- /dev/null
+++ b/Tests/VSWinStorePhone/WinRT/CMakeLists.txt
@@ -0,0 +1,13 @@
+project(JusticeLeagueWinRT CXX)
+
+# create project
+add_library(JusticeLeagueWinRT SHARED
+ "${CMAKE_CURRENT_SOURCE_DIR}/Batman.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Batman.h"
+)
+
+set_target_properties(JusticeLeagueWinRT PROPERTIES
+ VS_WINRT_COMPONENT TRUE
+ VS_GLOBAL_ROOTNAMESPACE "JusticeLeagueWinRT"
+ OUTPUT_NAME "JusticeLeagueWinRT"
+)