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
19 changes: 11 additions & 8 deletions nuget/Microsoft.Windows.CppWinRT.targets
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
CppWinRTCopyWinMDToOutputDirectory;
</AfterMidlTargets>
<ResolveAssemblyReferencesDependsOn>
$(ResolveAssemblyReferencesDependsOn);GetCppWinRTProjectWinMDReferences;CppWinRTRemoveStaticLibraries;
$(ResolveAssemblyReferencesDependsOn);GetCppWinRTProjectWinMDReferences;CppWinRTMarkStaticLibrariesPrivate;
</ResolveAssemblyReferencesDependsOn>
<!-- Note: Before* targets run before Compute* targets. -->
<BeforeClCompileTargets>
Expand Down Expand Up @@ -204,15 +204,18 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<Message Text="GetResolvedWinMD: @(WinMDFullPath->'%(FullPath)')" Importance="$(CppWinRTVerbosity)"/>
</Target>

<!-- Static library reference files are merged into the project that
references it. They shouldn't be included as actual project references.
Make sure that we've ran the GetCppWinRTProjectWinMDReferences target
and then remove them. -->
<Target Name="CppWinRTRemoveStaticLibraries"
DependsOnTargets="GetCppWinRTProjectWinMDReferences"
<!-- Static library reference WinMDs are merged into the project WinMD that
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

referenced

references it and might have the same name because they often share namespace.
Therefore they shouldn't be copied to the output folder
because they might override files in the output folder with the
same name, causing missing types. -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider "missing types when linking"

<Target Name="CppWinRTMarkStaticLibrariesPrivate"
DependsOnTargets="ResolveProjectReferences"
Returns="@(_ResolvedProjectReferencePaths)">
<ItemGroup>
<_ResolvedProjectReferencePaths Remove="@(_ResolvedProjectReferencePaths)" Condition="'%(_ResolvedProjectReferencePaths.ProjectType)' == 'StaticLibrary'" />
<_ResolvedProjectReferencePaths Condition="'%(_ResolvedProjectReferencePaths.ProjectType)' == 'StaticLibrary'">
<Private>false</Private>
</_ResolvedProjectReferencePaths>
</ItemGroup>
</Target>

Expand Down
34 changes: 34 additions & 0 deletions test/nuget/NuGetTest.sln
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestRuntimeComponentCSharp"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestRuntimeComponentNamespaceUnderscore", "TestRuntimeComponentNamespaceUnderscore\TestRuntimeComponentNamespaceUnderscore.vcxproj", "{8717FA32-34A8-457D-B77B-AE005703EB55}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestRuntimeComponentCXReferencingWinRTStaticLibrary", "TestRuntimeComponentCXReferencingWinRTStaticLibrary\TestRuntimeComponentCXReferencingWinRTStaticLibrary.vcxproj", "{FF846D79-F4B8-495A-9FB4-79BAAEB98E4F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestStaticLibrary7", "TestStaticLibrary7\TestStaticLibrary7.vcxproj", "{F89C2185-7834-443D-A449-53BD52FFEA3B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Expand Down Expand Up @@ -253,6 +257,36 @@ Global
{8717FA32-34A8-457D-B77B-AE005703EB55}.Release|x64.Build.0 = Release|x64
{8717FA32-34A8-457D-B77B-AE005703EB55}.Release|x86.ActiveCfg = Release|Win32
{8717FA32-34A8-457D-B77B-AE005703EB55}.Release|x86.Build.0 = Release|Win32
{FF846D79-F4B8-495A-9FB4-79BAAEB98E4F}.Debug|ARM.ActiveCfg = Debug|ARM
{FF846D79-F4B8-495A-9FB4-79BAAEB98E4F}.Debug|ARM.Build.0 = Debug|ARM
{FF846D79-F4B8-495A-9FB4-79BAAEB98E4F}.Debug|ARM64.ActiveCfg = Debug|ARM64
{FF846D79-F4B8-495A-9FB4-79BAAEB98E4F}.Debug|ARM64.Build.0 = Debug|ARM64
{FF846D79-F4B8-495A-9FB4-79BAAEB98E4F}.Debug|x64.ActiveCfg = Debug|x64
{FF846D79-F4B8-495A-9FB4-79BAAEB98E4F}.Debug|x64.Build.0 = Debug|x64
{FF846D79-F4B8-495A-9FB4-79BAAEB98E4F}.Debug|x86.ActiveCfg = Debug|Win32
{FF846D79-F4B8-495A-9FB4-79BAAEB98E4F}.Debug|x86.Build.0 = Debug|Win32
{FF846D79-F4B8-495A-9FB4-79BAAEB98E4F}.Release|ARM.ActiveCfg = Release|ARM
{FF846D79-F4B8-495A-9FB4-79BAAEB98E4F}.Release|ARM.Build.0 = Release|ARM
{FF846D79-F4B8-495A-9FB4-79BAAEB98E4F}.Release|ARM64.ActiveCfg = Release|ARM64
{FF846D79-F4B8-495A-9FB4-79BAAEB98E4F}.Release|ARM64.Build.0 = Release|ARM64
{FF846D79-F4B8-495A-9FB4-79BAAEB98E4F}.Release|x64.ActiveCfg = Release|x64
{FF846D79-F4B8-495A-9FB4-79BAAEB98E4F}.Release|x64.Build.0 = Release|x64
{FF846D79-F4B8-495A-9FB4-79BAAEB98E4F}.Release|x86.ActiveCfg = Release|Win32
{FF846D79-F4B8-495A-9FB4-79BAAEB98E4F}.Release|x86.Build.0 = Release|Win32
{F89C2185-7834-443D-A449-53BD52FFEA3B}.Debug|ARM.ActiveCfg = Debug|ARM
{F89C2185-7834-443D-A449-53BD52FFEA3B}.Debug|ARM.Build.0 = Debug|ARM
{F89C2185-7834-443D-A449-53BD52FFEA3B}.Debug|ARM64.ActiveCfg = Debug|Win32
{F89C2185-7834-443D-A449-53BD52FFEA3B}.Debug|x64.ActiveCfg = Debug|x64
{F89C2185-7834-443D-A449-53BD52FFEA3B}.Debug|x64.Build.0 = Debug|x64
{F89C2185-7834-443D-A449-53BD52FFEA3B}.Debug|x86.ActiveCfg = Debug|Win32
{F89C2185-7834-443D-A449-53BD52FFEA3B}.Debug|x86.Build.0 = Debug|Win32
{F89C2185-7834-443D-A449-53BD52FFEA3B}.Release|ARM.ActiveCfg = Release|ARM
{F89C2185-7834-443D-A449-53BD52FFEA3B}.Release|ARM.Build.0 = Release|ARM
{F89C2185-7834-443D-A449-53BD52FFEA3B}.Release|ARM64.ActiveCfg = Release|Win32
{F89C2185-7834-443D-A449-53BD52FFEA3B}.Release|x64.ActiveCfg = Release|x64
{F89C2185-7834-443D-A449-53BD52FFEA3B}.Release|x64.Build.0 = Release|x64
{F89C2185-7834-443D-A449-53BD52FFEA3B}.Release|x86.ActiveCfg = Release|Win32
{F89C2185-7834-443D-A449-53BD52FFEA3B}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "pch.h"
#include "CxClass.h"

using namespace TestRuntimeComponentCXLibrary;
using namespace Platform;

CxClass::CxClass(TestStaticLibrary7Class^ c)
{
c->Test();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma once

namespace TestRuntimeComponentCXLibrary
{
public ref class CxClass sealed
{
public:
CxClass(TestStaticLibrary7Class^ c);
};
}
Loading