Merged PR 15747367: Fixes for new VS 2026 build breaks

Syncing content from committish 6ba3316bb99518880a26984a70acac4ca04614bf
This commit is contained in:
reunion-maestro-bot committed 2026-06-03 01:18:25 +00:00
1 parent 96818ccae9
commit 262cf0f1f5
12 files changed
+28 -16

No files matched your search

+7
View File
@@ -3,6 +3,13 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<IsInWinUIRepo>true</IsInWinUIRepo>
<!-- Prevent the C++/WinRT NuGet package from injecting the deprecated /await switch;
injecting /await causes C++/WinRT to pull in the hard-deprecated (as of MSVC 14.51)
<experimental/coroutine> header.
We add /await:strict in Directory.Build.targets instead; /await:strict enables standard
C++20 coroutine support even when compiling in C++17 mode. -->
<CppWinRTEnableLegacyCoroutines>false</CppWinRTEnableLegacyCoroutines>
<!-- Locations for props/targets that can be included to directly consume binaries from the build -->
<ConsumeBinariesProps>$(MSBuildThisFileDirectory)eng\consumebinaries.props</ConsumeBinariesProps>
<ConsumeBinariesTargets>$(MSBuildThisFileDirectory)eng\consumebinaries.targets</ConsumeBinariesTargets>
+14
View File
@@ -25,6 +25,20 @@
<Import Project="eng\lightup.targets" />
<Import Project="$(ProjectRoot)\eng\WebView2ProjectionWorkaround.targets" />
<!--
Since in Directory.Build.props we prevented C++/WinRT from automatically injecting /await, we
need to add /await:strict in order to allow C++17 projects to use C++20-compliant coroutines.
While strictly speaking it's overly broad to enable this for _all_ C++17 projects, there is no
harm in doing so as all the switch does is _enable_ compiler support for coroutines; if a project
doesn't use coroutines then the presence of the switch has no effect.
-->
<ItemDefinitionGroup Condition="'$(MSBuildProjectExtension)' == '.vcxproj'">
<ClCompile>
<AdditionalOptions Condition="'%(ClCompile.LanguageStandard)' == 'stdcpp17'">%(AdditionalOptions) /await:strict</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
<!--
Workaround for CS0016 build failures when CodeQL is active in the pipeline.
+2 -2
View File
@@ -119,7 +119,7 @@ private:
class Iterator :
public ReferenceTracker<
Iterator,
reference_tracker_implements_t<winrt::IIterator<KVP>>::type>
typename reference_tracker_implements_t<winrt::IIterator<KVP>>::type>
{
public:
Iterator(HashMap<K, V>* map)
@@ -196,7 +196,7 @@ private:
class KeyValuePair :
public ReferenceTracker<
KeyValuePair,
reference_tracker_implements_t<winrt::IKeyValuePair<K, V>>::type>
typename reference_tracker_implements_t<winrt::IKeyValuePair<K, V>>::type>
{
public:
+1 -1
View File
@@ -67,7 +67,7 @@ public:
private:
class Iterator :
public ReferenceTracker<Iterator, reference_tracker_implements_t<winrt::IIterator<T>>::type>
public ReferenceTracker<Iterator, typename reference_tracker_implements_t<winrt::IIterator<T>>::type>
{
public:
Iterator(const winrt::IVectorView<T>& selectedItems)
@@ -70,7 +70,7 @@ private:
private:
class Iterator :
public ReferenceTracker<Iterator, reference_tracker_implements_t<winrt::IIterator<T>>::type>
public ReferenceTracker<Iterator, typename reference_tracker_implements_t<winrt::IIterator<T>>::type>
{
public:
Iterator(const winrt::IVectorView<T>& childCollection)
@@ -76,7 +76,7 @@
</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp20</LanguageStandard>
<DisableAnalyzeExternal>true</DisableAnalyzeExternal>
<AdditionalOptions>/bigobj /await %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/Wv:18 /Zc:lambda %(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError Condition="'$(ExperimentalAnalysis)'!='true'">true</TreatWarningAsError>
+2 -2
View File
@@ -519,7 +519,7 @@ struct Awaitable
}
// Registers a callback that will be called when the awaitable is completed.
void await_suspend(std::experimental::coroutine_handle<> resume)
void await_suspend(std::coroutine_handle<> resume)
{
m_wait.attach(
winrt::check_pointer(
@@ -543,7 +543,7 @@ private:
static void __stdcall CoroutineCompletedCallback(PTP_CALLBACK_INSTANCE, void* context, PTP_WAIT, TP_WAIT_RESULT) noexcept
{
// Resumes anyone waiting on the awaitable.
std::experimental::coroutine_handle<>::from_address(context)();
std::coroutine_handle<>::from_address(context)();
}
//
@@ -162,7 +162,6 @@
<XamlCppOptionsForWinRt>
/AI"$(ProjectSDKMetadataPath)"
/AI"$(VCToolsInstallDir)lib\x86\store\references"
/await
/Brepro
/d1import_no_registry
/d1ReturnUdtEHInline
-1
View File
@@ -8,7 +8,6 @@
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalOptions>%(AdditionalOptions) /await</AdditionalOptions>
<DisableSpecificWarnings>%(DisableSpecificWarnings);4189;4458;4691;4711;4945;34640</DisableSpecificWarnings>
</ClCompile>
</ItemDefinitionGroup>
@@ -14,9 +14,6 @@
#include <FlyoutHelper.h>
#include <ChangeDPI.h>
#include <experimental/resumable>
#include <pplawait.h>
#include "DisableDCompLeakDetectionScopeGuard.h"
using namespace Microsoft::UI::Xaml::Tests::Common;
@@ -50,7 +50,6 @@
$(WinUIDetailsIncludePath)\abi;
$(WinUIDetailsIncludePath)\MockDComp;
</AdditionalIncludeDirectories>
<AdditionalOptions>%(AdditionalOptions) /await</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>
@@ -19,9 +19,6 @@
#include "RuleTesterHelper.h"
#include <ThemeHelper.h>
#include <experimental/resumable>
#include <pplawait.h>
using namespace Microsoft::UI::Xaml;
using namespace Microsoft::UI::Xaml::Media;
using namespace Microsoft::UI::Xaml::Media::Animation;