Add natvis file, include in nuget (#237)
* Add natvis file, include in nuget * Include natvis in test build * Include natvis in nupkg * Add natvis for vcpkg
This commit is contained in:
Родитель
18c1ebd901
Коммит
aee497ee2e
|
@ -44,6 +44,12 @@ target_include_directories(${PROJECT_NAME} INTERFACE
|
|||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
)
|
||||
|
||||
# Include the .natvis files
|
||||
if (MSVC)
|
||||
target_sources(${PROJECT_NAME} INTERFACE
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/natvis/wil.natvis>")
|
||||
endif()
|
||||
|
||||
# Install Package Configuration
|
||||
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
|
||||
install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME_LOWER}_targets)
|
||||
|
|
|
@ -0,0 +1,105 @@
|
|||
<!--
|
||||
Copyright (c) Microsoft. All rights reserved.
|
||||
This code is licensed under the MIT License.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
-->
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
|
||||
<Type Name="wistd::_Func_impl<*>">
|
||||
<DisplayString>{_Callee._Object}</DisplayString>
|
||||
<Expand>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="wistd::function<*>">
|
||||
<DisplayString Condition="_Impl == 0">empty</DisplayString>
|
||||
<DisplayString Condition="_Impl != 0">{*_Impl}</DisplayString>
|
||||
<Expand>
|
||||
<ExpandedItem Condition="_Impl != 0">*_Impl</ExpandedItem>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="wistd::unique_ptr<*>">
|
||||
<DisplayString Condition="_Myptr == 0">empty</DisplayString>
|
||||
<DisplayString Condition="_Myptr != 0">{*_Myptr}</DisplayString>
|
||||
<StringView>_Myptr</StringView>
|
||||
<Expand>
|
||||
<Item Name="[pointer]" Condition="_Myptr != 0">_Myptr</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="wistd::unique_ptr<wchar_t[*],*>">
|
||||
<DisplayString Condition="_Myptr == 0">empty</DisplayString>
|
||||
<DisplayString Condition="_Myptr != 0">{_Myptr,su}</DisplayString>
|
||||
<StringView>_Myptr</StringView>
|
||||
<Expand>
|
||||
<Item Name="[pointer]" Condition="_Myptr != 0">_Myptr</Item>
|
||||
<Item Name="[length]" Condition="_Myptr != 0">wcslen(_Myptr)</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="wistd::unique_ptr<char[*],*>">
|
||||
<DisplayString Condition="_Myptr == 0">empty</DisplayString>
|
||||
<DisplayString Condition="_Myptr != 0">{_Myptr,s}</DisplayString>
|
||||
<StringView>_Myptr</StringView>
|
||||
<Expand>
|
||||
<Item Name="[pointer]" Condition="_Myptr != 0">_Myptr</Item>
|
||||
<Item Name="[length]" Condition="_Myptr != 0">strlen(_Myptr)</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="wil::details::shared_storage<*>">
|
||||
<DisplayString Condition="m_ptr == 0">empty</DisplayString>
|
||||
<DisplayString Condition="m_ptr != 0">{*m_ptr}</DisplayString>
|
||||
<StringView>m_ptr</StringView>
|
||||
<Expand>
|
||||
<Item Name="[pointer]" Condition="m_ptr != 0">m_ptr</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="wil::details::unique_storage<wil::details::handle_null_resource_policy<*>>">
|
||||
<DisplayString Condition="m_ptr == 0">empty</DisplayString>
|
||||
<DisplayString Condition="m_ptr != 0">{m_ptr}</DisplayString>
|
||||
<Expand>
|
||||
</Expand>
|
||||
</Type>
|
||||
<Type Name="wil::details::unique_storage<wil::details::handle_invalid_resource_policy<*>>">
|
||||
<DisplayString Condition="m_ptr == 0">empty</DisplayString>
|
||||
<DisplayString Condition="m_ptr != 0">{m_ptr}</DisplayString>
|
||||
<Expand>
|
||||
</Expand>
|
||||
</Type>
|
||||
<Type Name="wil::details::unique_storage<wil::details::resource_policy<*>>">
|
||||
<DisplayString Condition="m_ptr == 0">empty</DisplayString>
|
||||
<DisplayString Condition="m_ptr != 0">{m_ptr}</DisplayString>
|
||||
<StringView>m_ptr</StringView>
|
||||
<Expand>
|
||||
</Expand>
|
||||
</Type>
|
||||
<Type Name="wil::details::unique_storage<wil::details::resource_policy<wchar_t *,*>>">
|
||||
<DisplayString Condition="m_ptr == 0">empty</DisplayString>
|
||||
<DisplayString Condition="m_ptr != 0">{m_ptr,su}</DisplayString>
|
||||
<StringView>m_ptr</StringView>
|
||||
<Expand>
|
||||
<Item Name="[length]" Condition="m_ptr != 0">wcslen(m_ptr)</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
<Type Name="wil::details::unique_storage<wil::details::resource_policy<char *,*>>">
|
||||
<DisplayString Condition="m_ptr == 0">empty</DisplayString>
|
||||
<DisplayString Condition="m_ptr != 0">{m_ptr,s}</DisplayString>
|
||||
<StringView>m_ptr</StringView>
|
||||
<Expand>
|
||||
<Item Name="[length]" Condition="m_ptr != 0">strlen(m_ptr)</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="wil::com_ptr_t<*>">
|
||||
<DisplayString>{m_ptr}</DisplayString>
|
||||
<Expand>
|
||||
<ExpandedItem>m_ptr</ExpandedItem>
|
||||
</Expand>
|
||||
</Type>
|
||||
</AutoVisualizer>
|
|
@ -7,6 +7,7 @@ file(TO_NATIVE_PATH "${nupkg_dir}/Microsoft.Windows.ImplementationLibrary.${WIL_
|
|||
file(DOWNLOAD https://dist.nuget.org/win-x86-commandline/latest/nuget.exe ${nuget_exe})
|
||||
|
||||
file(GLOB_RECURSE wil_headers ${CMAKE_SOURCE_DIR}/include/*.h)
|
||||
file(GLOB_RECURSE wil_natvis ${CMAKE_SOURCE_DIR}/natvis/*.natvis)
|
||||
|
||||
add_custom_command(OUTPUT ${wil_nupkg}
|
||||
COMMAND ${nuget_exe} pack ${CMAKE_CURRENT_SOURCE_DIR}/Microsoft.Windows.ImplementationLibrary.nuspec -OutputDirectory ${nupkg_dir} -Version ${WIL_BUILD_VERSION} -NonInteractive
|
||||
|
@ -14,6 +15,7 @@ add_custom_command(OUTPUT ${wil_nupkg}
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/Microsoft.Windows.ImplementationLibrary.nuspec
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Microsoft.Windows.ImplementationLibrary.targets
|
||||
${wil_headers}
|
||||
${wil_natvis}
|
||||
${CMAKE_SOURCE_DIR}/LICENSE
|
||||
${CMAKE_SOURCE_DIR}/ThirdPartyNotices.txt)
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
<file src="..\..\LICENSE"/>
|
||||
<file src="..\..\ThirdPartyNotices.txt"/>
|
||||
<file src="..\..\include\**" target="include\" />
|
||||
<file src="..\..\natvis\wil.natvis" target="natvis\" />
|
||||
<file src="Microsoft.Windows.ImplementationLibrary.targets" target="build\native\" />
|
||||
</files>
|
||||
</package>
|
|
@ -5,4 +5,7 @@
|
|||
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)..\..\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="$(MSBuildThisFileDirectory)..\..\natvis\wil.natvis"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -50,6 +50,7 @@ set(COMMON_SOURCES
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/SafeCastTests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/WistdTests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wiTest.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../natvis/wil.natvis
|
||||
)
|
||||
|
||||
add_subdirectory(app)
|
||||
|
|
Загрузка…
Ссылка в новой задаче