зеркало из https://github.com/dotnet/wpf.git
1.5 KiB
1.5 KiB
C++ Notes
$(RepoRoot)eng\WpfArcadeSdk\tools\
containsWpf.Cpp.Props
,Wpf.Cpp.targets
,Wpf.Cpp.PrivateTools.props
andWpf.Cpp.PrivateTools.targets
, which contain all the important C++ related properties- We need to undefine the
TargetFramework
property whenProjectReference
-ing a C++/CLI project from a C# project- When a C++/CLI project is built directly from the solution,
TargetFramework=net6.0-windows
etc. property is NOT passed to it. - When the same project is built via a C# project, it receives a global property
TargetFramework=net6.0-windows
. - This results in msbuild treating those two instances as sufficiently different and builds them independently.
- In turn, the same project is built twice (often simultaneously), and results in simultaneous writes to the PDB etc.
- This leads to build failures.
- The solution is to delete
TargetFramework
property when specifyingProjectReference
to a C++/CLI project from a C# project, like this:<ProjectReference Include="$(WpfSourceDir)PresentationCore\CPP\PresentationCoreCpp.vcxproj"> <UndefineProperties>TargetFramework;TargetFrameworks</UndefineProperties> </ProjectReference>
- When a C++/CLI project is built directly from the solution,
Deprecated Compiler Features
- /nowarn:D9035 is now being passed to build.ps1 in order to suppress the following C++ compiler warnings:
- cl : Command line error D9035: option 'clr:pure' has been deprecated and will be removed in a future release
- cl : Command line error D9035: option 'Zc:forScope-' has been deprecated and will be removed in a future release