Skip to content

Commit 71a15b3

Browse files
committed
Clean back up some after finally detecting the warning Ive been trying to detect
1 parent ffdfecc commit 71a15b3

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

test/stress_test/GeneratePrecompiledHeader.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ foreach ($header in $allHeaders)
2020
{
2121
$chunks = $header.FullName.Split("\\");
2222
$header = $chunks[$chunks.Length - 1];
23-
$generatedPchContent += "#include `"winrt/$header`"`r`n";
23+
$generatedPchContent += "#include <winrt/$header>`r`n";
2424
}
2525

2626
Set-Content -Path "$generatedFilesDir\\pch.h" -Value $generatedPchContent -Force -Encoding UTF8

test/stress_test/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,9 @@ int main()
99
winrt::Windows::Foundation::Uri uri{ L"https://www.microsoft.com" };
1010
const auto asString = uri.ToString();
1111

12+
// Cause the "if constexpr" block to be reachable, possibly triggering a build warning.
13+
winrt::Windows::Networking::Sockets::StreamWebSocket socket{ nullptr };
14+
socket.Close(1000, L"");
15+
1216
return 0;
1317
}

test/stress_test/stress_test.vcxproj

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@
4040
<CppWinRTPackageDir>..\_build\$(Platform)\$(Configuration)</CppWinRTPackageDir>
4141
<CppWinRTPackage>false</CppWinRTPackage>
4242
<!-- Null out CAExcludePath so that the include files are not automatically excluded from analysis. -->
43-
<!-- <CAExcludePath></CAExcludePath> -->
44-
<!-- <RunCodeAnalysis>true</RunCodeAnalysis> -->
43+
<CAExcludePath>
44+
</CAExcludePath>
45+
<RunCodeAnalysis>true</RunCodeAnalysis>
4546
</PropertyGroup>
4647
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
4748
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
@@ -55,16 +56,18 @@
5556
<ItemDefinitionGroup>
5657
<ClCompile>
5758
<AdditionalIncludeDirectories>$(OutputPath);Generated Files;..;..\..\cppwinrt</AdditionalIncludeDirectories>
59+
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
5860
<TreatWarningAsError>true</TreatWarningAsError>
59-
<!-- <ExternalWarningLevel>Level4</ExternalWarningLevel> -->
60-
<!-- <ExternalTemplatesDiagnostics>true</ExternalTemplatesDiagnostics> -->
61-
<!-- <AnalyzeExternalRuleset>NativeRecommendedRules.ruleset</AnalyzeExternalRuleset> -->
61+
<ExternalWarningLevel>Level4</ExternalWarningLevel>
62+
<ExternalTemplatesDiagnostics>true</ExternalTemplatesDiagnostics>
63+
<AnalyzeExternalRuleset>AllRules.ruleset</AnalyzeExternalRuleset>
64+
<AdditionalOptions>%(AdditionalOptions) /Wv:19.40</AdditionalOptions>
65+
<EnablePREfast>true</EnablePREfast>
6266
</ClCompile>
6367
<Link>
6468
<SubSystem>Console</SubSystem>
6569
</Link>
6670
<PreBuildEvent>
67-
<!-- <Command>$(CppWinRTDir)cppwinrt -in $(OutputPath)test_component.winmd $(OutputPath)test_component_no_pch.winmd -out "$(ProjectDir)Generated Files" -ref sdk -verbose</Command> -->
6871
<Command>powershell.exe -NoProfile -NonInteractive -File "$(ProjectDir)GeneratePrecompiledHeader.ps1" -generatedFilesDir "$(ProjectDir)Generated Files" -cppwinrtHeaderFolder "$(CppWinRTDir)\winrt"</Command>
6972
</PreBuildEvent>
7073
</ItemDefinitionGroup>

0 commit comments

Comments
 (0)