-
Notifications
You must be signed in to change notification settings - Fork 264
Add Static Library project template. #402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Scottj1s
merged 7 commits into
microsoft:master
from
jlaanstra:user/jlaans/static-library-template
Oct 29, 2019
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fb3989c
Add Static Library template.
jlaanstra 2e26492
Explain how to use static libraries.
jlaanstra 70a728d
Remove cert wizard.
jlaanstra c35d324
Replace url everywhere.
jlaanstra 559734b
ALso add flags here.
jlaanstra ee4fa8c
Fix typo.
jlaanstra 68888f3
Merge branch 'master' into user/jlaans/static-library-template
Scottj1s File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
vsix/ProjectTemplates/VC/Windows Universal/StaticLibrary/Class.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #include "pch.h" | ||
| #include "Class.h" | ||
| #include "Class.g.cpp" | ||
|
|
||
| namespace winrt::$safeprojectname$::implementation | ||
| { | ||
| int32_t Class::MyProperty() | ||
| { | ||
| throw hresult_not_implemented(); | ||
| } | ||
|
|
||
| void Class::MyProperty(int32_t /* value */) | ||
| { | ||
| throw hresult_not_implemented(); | ||
| } | ||
| } |
21 changes: 21 additions & 0 deletions
21
vsix/ProjectTemplates/VC/Windows Universal/StaticLibrary/Class.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #pragma once | ||
|
|
||
| #include "Class.g.h" | ||
|
|
||
| namespace winrt::$safeprojectname$::implementation | ||
| { | ||
| struct Class : ClassT<Class> | ||
| { | ||
| Class() = default; | ||
|
|
||
| int32_t MyProperty(); | ||
| void MyProperty(int32_t value); | ||
| }; | ||
| } | ||
|
|
||
| namespace winrt::$safeprojectname$::factory_implementation | ||
| { | ||
| struct Class : ClassT<Class, implementation::Class> | ||
| { | ||
| }; | ||
| } |
9 changes: 9 additions & 0 deletions
9
vsix/ProjectTemplates/VC/Windows Universal/StaticLibrary/Class.idl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| namespace $safeprojectname$ | ||
| { | ||
| [default_interface] | ||
| runtimeclass Class | ||
| { | ||
| Class(); | ||
| Int32 MyProperty; | ||
| } | ||
| } |
16 changes: 16 additions & 0 deletions
16
vsix/ProjectTemplates/VC/Windows Universal/StaticLibrary/PropertySheet.props
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <ImportGroup Label="PropertySheets" /> | ||
| <PropertyGroup Label="UserMacros" /> | ||
| <!-- | ||
| To customize common C++/WinRT project properties: | ||
| * right-click the project node | ||
| * expand the Common Properties item | ||
| * select the C++/WinRT property page | ||
| For more advanced scenarios, and complete documentation, please see: | ||
| https://github.com/Microsoft/cppwinrt/tree/master/nuget | ||
| --> | ||
| <PropertyGroup /> | ||
| <ItemDefinitionGroup /> | ||
| </Project> |
136 changes: 136 additions & 0 deletions
136
vsix/ProjectTemplates/VC/Windows Universal/StaticLibrary/StaticLibrary.vcxproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <PropertyGroup Label="Globals"> | ||
| <CppWinRTOptimized>true</CppWinRTOptimized> | ||
| <CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge> | ||
| <CppWinRTParameters>-lib $(MSBuildProjectName)</CppWinRTParameters> | ||
| <MinimalCoreWin>true</MinimalCoreWin> | ||
| <ProjectGuid>{$guid1$}</ProjectGuid> | ||
| <ProjectName>$projectname$</ProjectName> | ||
| <RootNamespace>$safeprojectname$</RootNamespace> | ||
| <DefaultLanguage>en-US</DefaultLanguage> | ||
| <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion> | ||
| <AppContainerApplication>true</AppContainerApplication> | ||
| <ApplicationType>Windows Store</ApplicationType> | ||
| <ApplicationTypeRevision>10.0</ApplicationTypeRevision> | ||
| <WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">$targetplatformversion$</WindowsTargetPlatformVersion> | ||
| <WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion> | ||
| </PropertyGroup> | ||
| <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
| <ItemGroup Label="ProjectConfigurations"> | ||
| <ProjectConfiguration Include="Debug|ARM"> | ||
| <Configuration>Debug</Configuration> | ||
| <Platform>ARM</Platform> | ||
| </ProjectConfiguration> | ||
| <ProjectConfiguration Include="Debug|Win32"> | ||
| <Configuration>Debug</Configuration> | ||
| <Platform>Win32</Platform> | ||
| </ProjectConfiguration> | ||
| <ProjectConfiguration Include="Debug|x64"> | ||
| <Configuration>Debug</Configuration> | ||
| <Platform>x64</Platform> | ||
| </ProjectConfiguration> | ||
| <ProjectConfiguration Include="Release|ARM"> | ||
| <Configuration>Release</Configuration> | ||
| <Platform>ARM</Platform> | ||
| </ProjectConfiguration> | ||
| <ProjectConfiguration Include="Release|Win32"> | ||
| <Configuration>Release</Configuration> | ||
| <Platform>Win32</Platform> | ||
| </ProjectConfiguration> | ||
| <ProjectConfiguration Include="Release|x64"> | ||
| <Configuration>Release</Configuration> | ||
| <Platform>x64</Platform> | ||
| </ProjectConfiguration> | ||
| </ItemGroup> | ||
| <PropertyGroup Label="Configuration"> | ||
| <ConfigurationType>StaticLibrary</ConfigurationType> | ||
| <PlatformToolset>v140</PlatformToolset> | ||
| <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset> | ||
| <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset> | ||
| <CharacterSet>Unicode</CharacterSet> | ||
| <GenerateManifest>false</GenerateManifest> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> | ||
| <UseDebugLibraries>true</UseDebugLibraries> | ||
| <LinkIncremental>true</LinkIncremental> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"> | ||
| <UseDebugLibraries>false</UseDebugLibraries> | ||
| <WholeProgramOptimization>true</WholeProgramOptimization> | ||
| <LinkIncremental>false</LinkIncremental> | ||
| </PropertyGroup> | ||
| <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
| <ImportGroup Label="ExtensionSettings"> | ||
| </ImportGroup> | ||
| <ImportGroup Label="Shared"> | ||
| </ImportGroup> | ||
| <ImportGroup Label="PropertySheets"> | ||
| <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
| </ImportGroup> | ||
| <ImportGroup Label="PropertySheets"> | ||
| <Import Project="PropertySheet.props" /> | ||
| </ImportGroup> | ||
| <PropertyGroup Label="UserMacros" /> | ||
| <PropertyGroup /> | ||
| <ItemDefinitionGroup> | ||
| <ClCompile> | ||
| <PrecompiledHeader>Use</PrecompiledHeader> | ||
| <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> | ||
| <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile> | ||
| <WarningLevel>Level4</WarningLevel> | ||
| <AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions> | ||
| <!--Temporarily disable cppwinrt heap enforcement to work around xaml compiler generated std::shared_ptr use --> | ||
| <AdditionalOptions Condition="'$(CppWinRTHeapEnforcement)'==''">/DWINRT_NO_MAKE_DETECTION %(AdditionalOptions)</AdditionalOptions> | ||
| <DisableSpecificWarnings></DisableSpecificWarnings> | ||
| <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
| <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories> | ||
| </ClCompile> | ||
| <Link> | ||
| <SubSystem>Console</SubSystem> | ||
| <GenerateWindowsMetadata>false</GenerateWindowsMetadata> | ||
| <ModuleDefinitionFile>$safeprojectname$.def</ModuleDefinitionFile> | ||
| </Link> | ||
| </ItemDefinitionGroup> | ||
| <ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'"> | ||
| <ClCompile> | ||
| <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
| </ClCompile> | ||
| </ItemDefinitionGroup> | ||
| <ItemDefinitionGroup Condition="'$(Configuration)'=='Release'"> | ||
| <ClCompile> | ||
| <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
| </ClCompile> | ||
| <Link> | ||
| <EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
| <OptimizeReferences>true</OptimizeReferences> | ||
| </Link> | ||
| </ItemDefinitionGroup> | ||
| <ItemGroup> | ||
| <ClInclude Include="pch.h" /> | ||
| <ClInclude Include="Class.h"> | ||
| <DependentUpon>Class.idl</DependentUpon> | ||
| </ClInclude> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <ClCompile Include="pch.cpp"> | ||
| <PrecompiledHeader>Create</PrecompiledHeader> | ||
| </ClCompile> | ||
| <ClCompile Include="Class.cpp"> | ||
| <DependentUpon>Class.idl</DependentUpon> | ||
| </ClCompile> | ||
| <ClCompile Include="$(GeneratedFilesDir)module.g.cpp" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <Midl Include="Class.idl" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <None Include="PropertySheet.props" /> | ||
| <Text Include="readme.txt"> | ||
| <DeploymentContent>false</DeploymentContent> | ||
| </Text> | ||
| </ItemGroup> | ||
| <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
| <ImportGroup Label="ExtensionTargets"> | ||
| </ImportGroup> | ||
| </Project> |
32 changes: 32 additions & 0 deletions
32
vsix/ProjectTemplates/VC/Windows Universal/StaticLibrary/StaticLibrary.vcxproj.filters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <ItemGroup> | ||
| <Filter Include="Resources"> | ||
| <UniqueIdentifier>accd3aa8-1ba0-4223-9bbe-0c431709210b</UniqueIdentifier> | ||
| <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms</Extensions> | ||
| </Filter> | ||
| <Filter Include="Generated Files"> | ||
| <UniqueIdentifier>{926ab91d-31b4-48c3-b9a4-e681349f27f0}</UniqueIdentifier> | ||
| </Filter> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <ClCompile Include="pch.cpp" /> | ||
| <ClCompile Include="Class.cpp"/> | ||
| <ClCompile Include="Generated Files\module.g.cpp"> | ||
| <Filter>Generated Files</Filter> | ||
| </ClCompile> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <ClInclude Include="pch.h" /> | ||
| <ClCompile Include="Class.h"/> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <Midl Include="Class.idl" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <None Include="PropertySheet.props" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <Text Include="readme.txt" /> | ||
| </ItemGroup> | ||
| </Project> |
41 changes: 41 additions & 0 deletions
41
vsix/ProjectTemplates/VC/Windows Universal/StaticLibrary/cppwinrt_StaticLibrary.vstemplate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| <VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Project"> | ||
| <TemplateData> | ||
| <Name>Static Library (C++/WinRT)</Name> | ||
| <Description>A project for a C++/WinRT Static Library that can be used by a Universal Windows Platform app</Description> | ||
| <ProjectType>VC</ProjectType> | ||
| <SortOrder>3000</SortOrder> | ||
| <TemplateID>microsoft.Windows.CppWinRT.StaticLibrary</TemplateID> | ||
| <CreateNewFolder>true</CreateNewFolder> | ||
| <DefaultName>StaticLibrary</DefaultName> | ||
| <ProvideDefaultName>true</ProvideDefaultName> | ||
| <LocationField>Enabled</LocationField> | ||
| <EnableLocationBrowseButton>true</EnableLocationBrowseButton> | ||
| <Icon>cppwinrt.ico</Icon> | ||
| <PreviewImage>cppwinrt.png</PreviewImage> | ||
| </TemplateData> | ||
| <TemplateContent> | ||
| <Project TargetFileName="$safeprojectname$.vcxproj" File="StaticLibrary.vcxproj" ReplaceParameters="true"> | ||
| <ProjectItem ReplaceParameters="true" TargetFileName="$safeprojectname$.vcxproj.filters">StaticLibrary.vcxproj.filters</ProjectItem> | ||
| <ProjectItem ReplaceParameters="false" TargetFileName="pch.cpp">pch.cpp</ProjectItem> | ||
| <ProjectItem ReplaceParameters="false" TargetFileName="pch.h">pch.h</ProjectItem> | ||
| <ProjectItem ReplaceParameters="true" TargetFileName="Class.idl">Class.idl</ProjectItem> | ||
| <ProjectItem ReplaceParameters="true" TargetFileName="Class.cpp">Class.cpp</ProjectItem> | ||
| <ProjectItem ReplaceParameters="true" TargetFileName="Class.h">Class.h</ProjectItem> | ||
| <ProjectItem ReplaceParameters="false" TargetFileName="PropertySheet.props">PropertySheet.props</ProjectItem> | ||
| <ProjectItem ReplaceParameters="true" TargetFileName="readme.txt">readme.txt</ProjectItem> | ||
| </Project> | ||
| </TemplateContent> | ||
| <WizardExtension> | ||
jlaanstra marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <Assembly>Microsoft.VisualStudio.Universal.TemplateWizards, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly> | ||
| <FullClassName>Microsoft.VisualStudio.Universal.TemplateWizards.PlatformVersion.Wizard</FullClassName> | ||
| </WizardExtension> | ||
| <WizardExtension> | ||
| <Assembly>NuGet.VisualStudio.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly> | ||
| <FullClassName>NuGet.VisualStudio.TemplateWizard</FullClassName> | ||
| </WizardExtension> | ||
| <WizardData> | ||
| <packages repository="extension" repositoryId="Microsoft.Windows.CppWinRT"> | ||
| <package id="Microsoft.Windows.CppWinRT" version="1.0.0.0" /> | ||
| </packages> | ||
| </WizardData> | ||
| </VSTemplate> | ||
1 change: 1 addition & 0 deletions
1
vsix/ProjectTemplates/VC/Windows Universal/StaticLibrary/pch.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| #include "pch.h" |
4 changes: 4 additions & 0 deletions
4
vsix/ProjectTemplates/VC/Windows Universal/StaticLibrary/pch.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #pragma once | ||
| #include <unknwn.h> | ||
| #include <winrt/Windows.Foundation.h> | ||
| #include <winrt/Windows.Foundation.Collections.h> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that for VS 2019, you'll also want to add an entry for this template into project-metadata.json, so that it shows up on keyword filters. I would use a sort order value there of maybe 215.5, so it shows up just beneath the runtime component project. Example PR:
https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/162259
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, I'll submit that separate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Scottj1s looks like I don't have permissions to create PRs there. Can I leave this part to you?