mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-25 01:28:50 -05:00
Merge topic 'winrtrefs'
cff026dbc0VS: Fix WinRT component references6c21722adbTests: Fix VSWinStorePhone test with Windows 10 SDK 17763 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2906
This commit is contained in:
@@ -8,6 +8,8 @@ elseif(MSVC_VERSION GREATER 1600)
|
||||
set(COMPILER_VERSION "11")
|
||||
endif()
|
||||
|
||||
add_subdirectory(WinRT)
|
||||
|
||||
set (APP_MANIFEST_NAME Package.appxmanifest)
|
||||
if("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone")
|
||||
set(PLATFORM WP)
|
||||
@@ -139,11 +141,14 @@ if("${SHORT_VERSION}" STREQUAL "10.0")
|
||||
message(STATUS "Targeting Windows 10. Setting Extensions to version ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
|
||||
set_property(TARGET ${EXE_NAME} PROPERTY VS_DESKTOP_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
|
||||
set_property(TARGET ${EXE_NAME} PROPERTY VS_MOBILE_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
|
||||
set_property(TARGET ${EXE_NAME} PROPERTY VS_IOT_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
|
||||
|
||||
# The last IOT reference is on 10.0.17134.0, so only add it if supported
|
||||
if("${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}" VERSION_LESS "10.0.17135.0")
|
||||
set_property(TARGET ${EXE_NAME} PROPERTY VS_IOT_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
|
||||
endif()
|
||||
|
||||
# Add a reference to an SDK
|
||||
set_property(TARGET ${EXE_NAME} PROPERTY VS_SDK_REFERENCES "Microsoft.UniversalCRT.Debug, Version=${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
|
||||
endif()
|
||||
|
||||
|
||||
target_link_libraries(${EXE_NAME} d3d11)
|
||||
target_link_libraries(${EXE_NAME} d3d11 JusticeLeagueWinRT)
|
||||
|
||||
@@ -6,11 +6,15 @@ using namespace DirectX;
|
||||
using namespace Microsoft::WRL;
|
||||
using namespace Windows::Foundation;
|
||||
using namespace Windows::UI::Core;
|
||||
using namespace JusticeLeagueWinRT;
|
||||
|
||||
CubeRenderer::CubeRenderer()
|
||||
: m_loadingComplete(false)
|
||||
, m_indexCount(0)
|
||||
{
|
||||
// Create a new WinRT object to validate that we can link properly
|
||||
Batman ^ hero = ref new Batman();
|
||||
hero->savePeople();
|
||||
}
|
||||
|
||||
void CubeRenderer::CreateDeviceResources()
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#include "Batman.h"
|
||||
|
||||
using namespace JusticeLeagueWinRT;
|
||||
using namespace Platform;
|
||||
|
||||
Batman::Batman()
|
||||
{
|
||||
}
|
||||
|
||||
void Batman::savePeople()
|
||||
{
|
||||
int i = 0;
|
||||
i++;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
namespace JusticeLeagueWinRT {
|
||||
public
|
||||
ref class Batman sealed
|
||||
{
|
||||
public:
|
||||
Batman();
|
||||
|
||||
void savePeople();
|
||||
};
|
||||
}
|
||||
@@ -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"
|
||||
)
|
||||
Reference in New Issue
Block a user