Browse Source

VS: When not referencing output assembly do not try to copy it either

When generating a `ProjectReference` with `ReferenceOutputAssembly` set
to `false`, also set `CopyToOutputDirectory` to `Never`.  Otherwise
MSBuild might report a diagnostic like

    Project '<name>' is not up to date.
    CopyLocal reference '...\ZERO_CHECK' is missing from output location.

and rebuild the referencing project unnecessarily.
Andreas Schönle 7 years ago
parent
commit
91754b4e60
1 changed files with 1 additions and 0 deletions
  1. 1 0
      Source/cmVisualStudio10TargetGenerator.cxx

+ 1 - 0
Source/cmVisualStudio10TargetGenerator.cxx

@@ -3816,6 +3816,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0)
       }
       if (dt->GetManagedType("") < check || unmanagedStatic) {
         e2.Element("ReferenceOutputAssembly", "false");
+        e2.Element("CopyToOutputDirectory", "Never");
       }
     }
     e2.EndElement();