From 4fdee21a636fca58ba9a3028a33d398f5bfd7178 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 15 Apr 2021 08:08:04 -0700 Subject: [PATCH] Pass down AdditionalProperties for NativeProjectReferences. Precalculate if the generator is multi-config so the CopyNativeProjectBinaries target doesn't need to call into the CMake project (#7237) --- .../build/Microsoft.DotNet.CMake.Sdk.targets | 5 ++++- .../sdk/ProjectReference.targets | 18 ++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Microsoft.DotNet.CMake.Sdk/build/Microsoft.DotNet.CMake.Sdk.targets b/src/Microsoft.DotNet.CMake.Sdk/build/Microsoft.DotNet.CMake.Sdk.targets index 7ae90ea3044..f8b6cc87f79 100644 --- a/src/Microsoft.DotNet.CMake.Sdk/build/Microsoft.DotNet.CMake.Sdk.targets +++ b/src/Microsoft.DotNet.CMake.Sdk/build/Microsoft.DotNet.CMake.Sdk.targets @@ -67,7 +67,7 @@ - + <_NormalizedReferencedCMakeListsDirectory>$([System.IO.Path]::GetDirectoryName($(ReferencedCMakeLists))) @@ -83,6 +83,9 @@ <_CMakeProjectReferenceFilesLocation Condition="'$(_CMakeMultiConfigurationGenerator)' == 'true'">$([MSBuild]::NormalizePath('$(_CMakeProjectReferenceFilesLocation)','$(Configuration)')) + + <_CMakeProjectReferenceFilesLocationItem Include="$(_CMakeProjectReferenceFilesLocation)" IsMultiConfigurationGenerator="_CMakeMultiConfigurationGenerator" /> + - - - - - + - + @@ -122,12 +117,14 @@ + Properties="ReferencedCMakeLists=%(NativeProjectReferenceNormalized.Identity);%(NativeProjectReferenceNormalized.AdditionalProperties)"> - <_NativeProjectReferenceToBuild Include="%(NativeProjectReferenceNormalized.CMakeProject)" Condition="'%(NativeProjectReferenceNormalized.BuildNative)' == 'true'" /> + <_NativeProjectReferenceToBuild Include="%(NativeProjectReferenceNormalized.CMakeProject)" + Condition="'%(NativeProjectReferenceNormalized.BuildNative)' == 'true'" + AdditionalProperties="%(NativeProjectReferenceNormalized.AdditionalProperties)" /> @@ -142,7 +139,8 @@