Skip to content

Commit

Permalink
Warn when building C++/CLI tests not in a command prompt and don't tr…
Browse files Browse the repository at this point in the history
…y copying the files if we aren't in one (dotnet#96465)

This will allow devs to use dotnet build to build the Interop test suite and still run non C++/CLI tests while using `dotnet build`.
  • Loading branch information
jkoritzinsky authored Jan 4, 2024
1 parent d3be0ec commit fac60d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tests/Interop/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
<Target Name="CopyInteropNativeRuntimeDependencies"
BeforeTargets="CopyAllNativeProjectReferenceBinaries"
Condition="'$(TargetsWindows)' == 'true' And ('$(Configuration)' == 'Debug' Or '$(Configuration)' == 'Checked') And '$(CopyDebugCRTDllsToOutputDirectory)' == 'true'" >
<Warning Message="Building C++/CLI tests requires a Visual Studio Dev Command Prompt" Condition="'$(VCToolsRedistDir)' == '' or '$(ExtensionSdkDir)' == ''" />
<!-- Required debug vcruntime and UCRT dlls -->
<ItemGroup>
<ItemGroup Condition="'$(VCToolsRedistDir)' != '' and '$(ExtensionSdkDir)' != ''">
<InteropNativeRuntimeDependencies Include="$(VCToolsRedistDir)onecore/debug_nonredist/$(TargetArchitecture)/Microsoft.VC*.DebugCRT/vcruntime*d.dll" />
<InteropNativeRuntimeDependencies Include="$(VCToolsRedistDir)onecore/debug_nonredist/$(TargetArchitecture)/Microsoft.VC*.DebugCRT/msvcp*d.dll" />
<InteropNativeRuntimeDependencies Include="$(ExtensionSdkDir)/Microsoft.UniversalCRT.Debug/$(UCRTVersion)/Redist/Debug/$(TargetArchitecture)/ucrtbased.dll" />
Expand Down

0 comments on commit fac60d0

Please sign in to comment.