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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*_i.c
*_p.c
*.c
*.nupkg
test*.xml
build
packages
Expand Down
Binary file removed Microsoft.Windows.CppWinRT.1.0.0.nupkg
Binary file not shown.
13 changes: 13 additions & 0 deletions build_nuget.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
rem @echo off

set target_version=%1
if "%target_version%"=="" set target_version=1.2.3.4

call msbuild /m /p:Configuration=Release,Platform=x86,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:fast_fwd
call msbuild /m /p:Configuration=Release,Platform=x64,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:fast_fwd
call msbuild /m /p:Configuration=Release,Platform=arm,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:fast_fwd
call msbuild /m /p:Configuration=Release,Platform=arm64,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:fast_fwd

call msbuild /m /p:Configuration=Release,Platform=x86,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:cppwinrt

nuget pack nuget\Microsoft.Windows.CppWinRT.nuspec -Properties cppwinrt_exe=%cd%\_build\x86\Release\cppwinrt.exe;cppwinrt_fast_fwd_x86=%cd%\_build\x86\Release\cppwinrt_fast_forwarder.lib;cppwinrt_fast_fwd_x64=%cd%\_build\x64\Release\cppwinrt_fast_forwarder.lib;cppwinrt_fast_fwd_arm=%cd%\_build\arm\Release\cppwinrt_fast_forwarder.lib;cppwinrt_fast_fwd_arm64=%cd%\_build\arm64\Release\cppwinrt_fast_forwarder.lib
6 changes: 0 additions & 6 deletions nuget/Microsoft.Windows.CppWinRT.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<ClCompile>
<CompileAsWinRT Condition="'$(CppWinRTProjectLanguage)' != 'C++/CX' And '%(ClCompile.CompileAsWinRT)' == ''">false</CompileAsWinRT>
<LanguageStandard Condition="'%(ClCompile.LanguageStandard)' == ''">stdcpp17</LanguageStandard>
<AdditionalOptions>/bigobj /await %(AdditionalOptions)</AdditionalOptions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(GeneratedFilesDir)</AdditionalIncludeDirectories>
</ClCompile>
<Midl Condition="'$(CppWinRTModernIDL)' != 'false'">
<AdditionalOptions>%(AdditionalOptions) /nomidl</AdditionalOptions>
<EnableWindowsRuntime>true</EnableWindowsRuntime>
<MetadataFileName>$(IntDir)Unmerged\%(Filename).winmd</MetadataFileName>
<GenerateClientFiles Condition="'%(Midl.GenerateClientFiles)'==''">None</GenerateClientFiles>
Expand All @@ -46,9 +43,6 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<ProxyFileName Condition="'%(Midl.ProxyFileName)'==''">nul</ProxyFileName>
<TypeLibraryName Condition="'%(Midl.TypeLibraryName)'==''"></TypeLibraryName>
</Midl>
<Link>
<AdditionalDependencies Condition="'$(CppWinRTLibs)' != 'false'">WindowsApp.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>

<ItemGroup>
Expand Down
33 changes: 17 additions & 16 deletions nuget/Microsoft.Windows.CppWinRT.targets
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<CppWinRTWriteOnlyWhenDifferent Condition="'$(CppWinRTWriteOnlyWhenDifferent)' != 'true'">false</CppWinRTWriteOnlyWhenDifferent>
<CppWinRTPackageDir Condition="'$(CppWinRTPackage)' == 'true' and '$(CppWinRTPackageDir)'==''">$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)))..\..\</CppWinRTPackageDir>
<CppWinRTPackageDir Condition="'$(CppWinRTPackage)' != 'true' and '$(CppWinRTPackageDir)'==''">$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)))</CppWinRTPackageDir>
<CppWinRTParameters Condition="'$(CppWinRTFastAbi)'=='true'">$(CppWinRTParameters) -fastabi</CppWinRTParameters>
<CppWinRTPath Condition="'$(CppWinRTPackage)' == 'true' and '$(CppWinRTPath)'==''">"$(CppWinRTPackageDir)bin\"</CppWinRTPath>
<CppWinRTPath Condition="'$(CppWinRTPackage)' != 'true' and '$(CppWinRTPath)'==''">"$(CppWinRTPackageDir)"</CppWinRTPath>
<XamlLanguage Condition="'$(CppWinRTProjectLanguage)' == 'C++/CX'">C++</XamlLanguage>
Expand Down Expand Up @@ -93,13 +94,6 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<IncludeCopyWinMDArtifactsOutputGroup>false</IncludeCopyWinMDArtifactsOutputGroup>
</PropertyGroup>

<ItemDefinitionGroup>
<Midl Condition="'$(CppWinRTModernIDL)' != 'false'">
<AdditionalMetadataDirectories Condition="'%(AdditionalMetadataDirectories)' == '' And '$(WindowsSDK_MetadataFoundationPath)' != ''">$(WindowsSDK_MetadataFoundationPath);%(AdditionalMetadataDirectories)</AdditionalMetadataDirectories>
<AdditionalMetadataDirectories Condition="'%(AdditionalMetadataDirectories)' == '' And '$(WindowsSDK_MetadataFoundationPath)' == ''">$(WindowsSDK_MetadataPath);%(AdditionalMetadataDirectories)</AdditionalMetadataDirectories>
</Midl>
</ItemDefinitionGroup>

<Target Name="CppWinRTVerifyKitVersion" Condition="'$(CppWinRTOverrideSDKReferences)' != 'true'">
<PropertyGroup>
<_CppWinRT_RS4OrGreater>false</_CppWinRT_RS4OrGreater>
Expand Down Expand Up @@ -626,14 +620,21 @@ $(XamlMetaDataProviderPch)
</PropertyGroup>
</Target>

<!-- Fast ABI component support -->
<PropertyGroup Condition="'$(CppWinRTFastAbi)'=='true'">
<CppWinRTParameters>$(CppWinRTParameters) -fastabi</CppWinRTParameters>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(CppWinRTFastAbi)'=='true'">
<Link>
<AdditionalDependencies>%(AdditionalDependencies);$(CppWinRTPackageDir)build\native\lib\$(Platform)\cppwinrt_fast_forwarder.lib</AdditionalDependencies>
</Link>
<!--Append any additional item metadata after all default and project settings have been applied-->
<ItemDefinitionGroup>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /bigobj /await</AdditionalOptions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(GeneratedFilesDir)</AdditionalIncludeDirectories>
</ClCompile>
<Midl Condition="'$(CppWinRTModernIDL)' != 'false'">
<AdditionalMetadataDirectories Condition="'%(AdditionalMetadataDirectories)' == '' And '$(WindowsSDK_MetadataFoundationPath)' != ''">$(WindowsSDK_MetadataFoundationPath);%(AdditionalMetadataDirectories)</AdditionalMetadataDirectories>
<AdditionalMetadataDirectories Condition="'%(AdditionalMetadataDirectories)' == '' And '$(WindowsSDK_MetadataFoundationPath)' == ''">$(WindowsSDK_MetadataPath);%(AdditionalMetadataDirectories)</AdditionalMetadataDirectories>
<AdditionalOptions>%(AdditionalOptions) /nomidl</AdditionalOptions>
</Midl>
<Link>
<AdditionalDependencies Condition="'$(CppWinRTLibs)' != 'false'">%(AdditionalDependencies);WindowsApp.lib</AdditionalDependencies>
<AdditionalDependencies Condition="'$(CppWinRTFastAbi)'=='true'">%(AdditionalDependencies);$(CppWinRTPackageDir)build\native\lib\$(Platform)\cppwinrt_fast_forwarder.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>

</Project>
10 changes: 5 additions & 5 deletions nuget/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Please visit [Microsoft.Windows.CppWinRT](https://www.nuget.org/packages/Microso

To add build support for C++/WinRT vcxproj projects, add a reference to the Microsoft.Windows.CppWinRT NuGet package. This customizes your project's build rules to automatically generate C++/WinRT projection headers, enabling you to both consume and produce Windows Runtime classes.

C++/WinRT detects Windows metadata referenced by the project, from:
C++/WinRT detects Windows metadata required by the project, from:
* Platform winmd files in the SDK (both MSI and NuGet)
* NuGet packages containing winmd files
* Other projects producing winmd files
* Raw winmd files
* NuGet package references containing winmd files
* Other project references producing winmd files
* Raw winmd file references
* Interface definition language (IDL) files in the project

For any winmd file referenced by the project, C++/WinRT creates reference (consuming) projection headers. Client code can simply #include these headers, which are created in the generated files directory (see below).
For any winmd file discovered above, C++/WinRT creates reference (consuming) projection headers. Client code can simply #include these headers, which are created in the generated files directory (see below).

For any IDL file contained in the project, C++/WinRT creates component (producing) projection headers. In addition, C++/WinRT generates templates and skeleton implementations for each runtime class, under the generated files directory.

Expand Down
12 changes: 6 additions & 6 deletions nuget/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ The Microsoft.Windows.CppWinRT NuGet package automatically generates C++/WinRT p
enabling you to both consume and produce Windows Runtime classes.
========================================================================

C++/WinRT detects Windows metadata referenced by the project, from:
C++/WinRT detects Windows metadata required by the project, from:
* Platform winmd files in the SDK (both MSI and NuGet)
* NuGet packages containing winmd files
* Other projects producing winmd files
* Raw winmd files
* NuGet package references containing winmd files
* Other project references producing winmd files
* Raw winmd file references
* Interface definition language (IDL) files in the project

For any winmd file referenced by the project, C++/WinRT creates reference (consuming) projection headers.
Client code can simply #include these headers, which are created in the Generated Files directory.
For any winmd file discovered above, C++/WinRT creates reference (consuming) projection headers.
Client code can simply #include these headers, which are created in the generated files directory (see below).

For any IDL file contained in the project, C++/WinRT creates component (producing) projection headers.
In addition, C++/WinRT generates templates and skeleton implementations for each runtime class, under the Generated Files directory.
Expand Down