Files
microsoft-ui-xaml/Directory.Build.targets
reunion-maestro-bot 262cf0f1f5 Merged PR 15747367: Fixes for new VS 2026 build breaks
Syncing content from committish 6ba3316bb99518880a26984a70acac4ca04614bf
2026-06-03 01:18:25 +00:00

57 lines
3.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Corporation. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<Link>
<EnableCOMDATFolding>false</EnableCOMDATFolding>
<OptimizeReferences>false</OptimizeReferences>
<LinkIncremental>true</LinkIncremental>
</Link>
</ItemDefinitionGroup>
<Import Project="eng\configuration.arm64ec.targets" Condition="'$(Platform)'=='ARM64EC'"/>
<Import Project="eng\sdkconfig.targets" />
<Import Project="eng\crtstl.targets" Condition="('$(UseLocalSDK)' != 'true' and '$(ResourceOnlyDll)' != 'true') and '$(MSBuildProjectExtension)' == '.vcxproj'" />
<Import Project="eng\winuidetails.targets" />
<Import Project="eng\binplace.targets"/>
<Import Project="eng\externalbinaries.targets"/>
<Import Project="eng\midl.targets" Condition="'$(IsWinmdProject)' == 'true'" />
<Import Project="eng\winrtclassregistration.targets" Condition="'$(GenerateWinRTClassRegistration)' == 'true'" />
<Import Project="eng\packaging.targets" />
<Import Project="eng\usexamlcompiler.targets" Condition="'$(UseXamlCompiler)'=='true'" />
<Import Project="eng\testprojects.targets" Condition="'$(TestCode)'=='true'" />
<Import Project="eng\adhocapp.targets" Condition="'$(AdHocApp)'=='true'"/>
<Import Project="eng\graph.targets" Condition="'$(IsGraphBuild)' == 'true'" />
<Import Project="eng\projectcaching.targets" />
<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.
The CodeQL3000Init task sets the MSBuild property EmitCompilerGeneratedFiles=true so that
Roslyn writes source-generator output to disk for static analysis. The SDK target
CreateCompilerGeneratedFilesOutputPath (in Microsoft.Managed.Core.targets) creates the
required '$(CompilerGeneratedFilesOutputPath)' directory (default: $(IntermediateOutputPath)generated),
but it is wired only to BeforeTargets="CoreCompile".
This is a no-op when CodeQL is not active (EmitCompilerGeneratedFiles is empty/false).
Scoped to C# project files only; XamlPreCompile is C#-specific.
-->
<Target Name="CreateCompilerGeneratedFilesOutputPathBeforeXamlPreCompile"
DependsOnTargets="CreateCompilerGeneratedFilesOutputPath"
BeforeTargets="XamlPreCompile"
Condition="'$(EmitCompilerGeneratedFiles)' == 'true' and '$(MSBuildProjectExtension)' == '.csproj'" />
</Project>