Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion nuget/Microsoft.Windows.CppWinRT.targets
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,14 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<MdMergeOutputFile>$(CppWinRTProjectWinMD)</MdMergeOutputFile>
</_MdMergeInputs>
<!-- Static libraries don't mdmerge other static libraries.
Instead they are passed independent inputs for the compoenent projection. -->
Instead they are passed as independent inputs for the component projection. -->
<_MdMergeInputs Include="@(CppWinRTStaticProjectWinMDReferences)" Condition="'$(ConfigurationType)' != 'StaticLibrary'">
<MdMergeOutputFile>$(CppWinRTProjectWinMD)</MdMergeOutputFile>
</_MdMergeInputs>
<_MdMergeReferences Remove="@(_MdMergeReferences)" />
<!-- Static libraries don't mdmerge other static libraries.
They are however used as references so idl can reference classes from other libs. -->
<_MdMergeReferences Include="@(CppWinRTStaticProjectWinMDReferences)" Condition="'$(ConfigurationType)' == 'StaticLibrary'" />
<_MdMergeReferences Include="@(CppWinRTDirectWinMDReferences)" />
<_MdMergeReferences Include="@(CppWinRTDynamicProjectWinMDReferences)" />
<_MdMergeReferences Include="@(CppWinRTPlatformWinMDReferences)" />
Expand Down
5 changes: 4 additions & 1 deletion test/nuget/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

<Import Condition="Exists($([MSBuild]::GetPathOfFileAbove('Directory.Build.props','$(MSBuildThisFileDirectory)../')))" Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props','$(MSBuildThisFileDirectory)../'))" />

<PropertyGroup>
<PropertyGroup>
<PlatformDirectoryName Condition="'$(Platform)' == 'Win32'">x86</PlatformDirectoryName>
<PlatformDirectoryName Condition="'$(Platform)' != 'Win32'">$(Platform)</PlatformDirectoryName>

<!-- Consistent output directory for AppContainer and non-AppContainer projects -->
<!-- Build overrides the roots. -->
<GenerateProjectSpecificOutputFolder>false</GenerateProjectSpecificOutputFolder>
Expand Down
8 changes: 5 additions & 3 deletions test/nuget/TestApp/MainPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using namespace winrt;
using namespace Windows::UI::Xaml;

using namespace winrt::TestApp::Library1;
using namespace winrt::TestApp::Library4;
using namespace winrt::TestRuntimeComponent1;
using namespace winrt::TestRuntimeComponent2;
using namespace winrt::TestRuntimeComponentCX;
Expand All @@ -30,12 +32,12 @@ namespace winrt::TestApp::implementation
TestRuntimeComponentNamespaceUnderscoreClass cUnderscore{};
cUnderscore.Test();

TestStaticLibrary1Class cStatic1{};
cStatic1.Test();

TestStaticLibrary4Class cStatic4{};
cStatic4.Test();

TestStaticLibrary1Class cStatic1{};
cStatic1.Test(cStatic4);

TestStaticLibrary5Class cStatic5{};
cStatic5.Test();

Expand Down
2 changes: 2 additions & 0 deletions test/nuget/TestApp/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <winrt/Windows.UI.Xaml.Markup.h>
#include <winrt/Windows.UI.Xaml.Navigation.h>

#include <winrt/TestApp.Library1.h>
#include <winrt/TestApp.Library4.h>
#include <winrt/TestRuntimeComponent1.h>
#include <winrt/TestRuntimeComponent2.h>
#include <winrt/TestRuntimeComponentCX.h>
Expand Down
4 changes: 1 addition & 3 deletions test/nuget/TestRuntimeComponent2/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ int32_t __stdcall WINRT_CanUnloadNow() noexcept

int32_t __stdcall WINRT_GetActivationFactory(void* classId, void** factory) noexcept try
{
uint32_t length{};
wchar_t const* const buffer = WINRT_WindowsGetStringRawBuffer(classId, &length);
std::wstring_view const name{ buffer, length };
std::wstring_view const name{ *reinterpret_cast<winrt::hstring*>(&classId) };
*factory = winrt_get_activation_factory(name);

if (*factory)
Expand Down
4 changes: 1 addition & 3 deletions test/nuget/TestRuntimeComponent3/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ int32_t __stdcall WINRT_CanUnloadNow() noexcept

int32_t __stdcall WINRT_GetActivationFactory(void* classId, void** factory) noexcept try
{
uint32_t length{};
wchar_t const* const buffer = WINRT_WindowsGetStringRawBuffer(classId, &length);
std::wstring_view const name{ buffer, length };
std::wstring_view const name{ *reinterpret_cast<winrt::hstring*>(&classId) };
*factory = winrt_get_activation_factory(name);

if (*factory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,6 @@
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<AllowCrossPlatformRetargeting>false</AllowCrossPlatformRetargeting>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
Expand Down
4 changes: 1 addition & 3 deletions test/nuget/TestRuntimeComponentEmpty/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ int32_t __stdcall WINRT_CanUnloadNow() noexcept

int32_t __stdcall WINRT_GetActivationFactory(void* classId, void** factory) noexcept try
{
uint32_t length{};
wchar_t const* const buffer = WINRT_WindowsGetStringRawBuffer(classId, &length);
std::wstring_view const name{ buffer, length };
std::wstring_view const name{ *reinterpret_cast<winrt::hstring*>(&classId) };
*factory = winrt_get_activation_factory(name);

if (*factory)
Expand Down
2 changes: 1 addition & 1 deletion test/nuget/TestStaticLibrary1/TestStaticLibrary1.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ProjectGuid>{2158F418-CA97-4599-8103-EFC133850BAA}</ProjectGuid>
<Keyword>StaticLibrary</Keyword>
<ProjectName>TestStaticLibrary1</ProjectName>
<RootNamespace>TestApp</RootNamespace>
<RootNamespace>TestApp.Library1</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
Expand Down
7 changes: 4 additions & 3 deletions test/nuget/TestStaticLibrary1/TestStaticLibrary1Class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
#include "TestStaticLibrary1Class.h"
#include "TestStaticLibrary1Class.g.cpp"

namespace winrt::TestApp::implementation
using namespace winrt::TestApp::Library4;

namespace winrt::TestApp::Library1::implementation
{
void TestStaticLibrary1Class::Test()
void TestStaticLibrary1Class::Test(TestStaticLibrary4Class const& c)
{
TestStaticLibrary4Class c{};
c.Test();
}
}
6 changes: 3 additions & 3 deletions test/nuget/TestStaticLibrary1/TestStaticLibrary1Class.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#pragma once
#include "TestStaticLibrary1Class.g.h"

namespace winrt::TestApp::implementation
namespace winrt::TestApp::Library1::implementation
{
struct TestStaticLibrary1Class : TestStaticLibrary1ClassT<TestStaticLibrary1Class>
{
TestStaticLibrary1Class() = default;

void Test();
void Test(TestApp::Library4::TestStaticLibrary4Class const& c);
};
}
namespace winrt::TestApp::factory_implementation
namespace winrt::TestApp::Library1::factory_implementation
{
struct TestStaticLibrary1Class : TestStaticLibrary1ClassT<TestStaticLibrary1Class, implementation::TestStaticLibrary1Class>
{
Expand Down
4 changes: 2 additions & 2 deletions test/nuget/TestStaticLibrary1/TestStaticLibrary1Class.idl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace TestApp
namespace TestApp.Library1
{
[default_interface]
runtimeclass TestStaticLibrary1Class
{
TestStaticLibrary1Class();

void Test();
void Test(TestApp.Library4.TestStaticLibrary4Class c);
}
}
2 changes: 1 addition & 1 deletion test/nuget/TestStaticLibrary1/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

#define WIN32_LEAN_AND_MEAN

#include "winrt/TestApp.h"
#include "winrt/TestApp.Library4.h"
2 changes: 1 addition & 1 deletion test/nuget/TestStaticLibrary4/TestStaticLibrary4.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<MinimalCoreWin>true</MinimalCoreWin>
<ProjectGuid>{432068a4-b206-4468-9254-446cceb15a2c}</ProjectGuid>
<Keyword>StaticLibrary</Keyword>
<RootNamespace>TestApp</RootNamespace>
<RootNamespace>TestApp.Library4</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
Expand Down
2 changes: 1 addition & 1 deletion test/nuget/TestStaticLibrary4/TestStaticLibrary4Class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using namespace winrt;
using namespace winrt::Windows::UI::Xaml::Core::Direct;

namespace winrt::TestApp::implementation
namespace winrt::TestApp::Library4::implementation
{
XamlDirect TestStaticLibrary4Class::Test()
{
Expand Down
4 changes: 2 additions & 2 deletions test/nuget/TestStaticLibrary4/TestStaticLibrary4Class.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "TestStaticLibrary4Class.g.h"

namespace winrt::TestApp::implementation
namespace winrt::TestApp::Library4::implementation
{
struct TestStaticLibrary4Class : TestStaticLibrary4ClassT<TestStaticLibrary4Class>
{
Expand All @@ -12,7 +12,7 @@ namespace winrt::TestApp::implementation
};
}

namespace winrt::TestApp::factory_implementation
namespace winrt::TestApp::Library4::factory_implementation
{
struct TestStaticLibrary4Class : TestStaticLibrary4ClassT<TestStaticLibrary4Class, implementation::TestStaticLibrary4Class>
{
Expand Down
2 changes: 1 addition & 1 deletion test/nuget/TestStaticLibrary4/TestStaticLibrary4Class.idl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TestApp
namespace TestApp.Library4
{
[default_interface]
runtimeclass TestStaticLibrary4Class
Expand Down