|
42 | 42 | <WriteLinesToFile File="$(_TripletFile)" Lines="$(VcpkgTriplet)" Overwrite="true" /> |
43 | 43 | </Target> |
44 | 44 |
|
45 | | - <!-- Note: Visual Studio does not build the .sln in the same way that MSBuild.exe does, so the above target is not executed. |
46 | | - In that case we try to write the file on the first project we build. |
47 | | - There is a race condition for parallel builds in doing this, but it won't happen on pipeline builds... --> |
| 45 | + <!-- Note: Visual Studio does not build the .sln in the same way that MSBuild.exe does. |
| 46 | + VS builds each project directly, instead of calling MSBuild on the .sln. |
| 47 | + This means that in VS the file is not written in the previous task, so we try to write it on the first project we build. |
| 48 | + There is a race condition for parallel builds in doing this, but it is unlikely and it cannot happen in pipeline (official) builds. --> |
48 | 49 | <Target Name="WriteProjectTripletToFile" |
49 | 50 | BeforeTargets="EnsureNoTripletMismatch" |
50 | 51 | Condition="!Exists('$(_TripletFile)')"> |
|
63 | 64 | <_SolutionTriplet>@(_TripletFileLines)</_SolutionTriplet> |
64 | 65 | </PropertyGroup> |
65 | 66 |
|
| 67 | + <!-- For the dev inner loop using VS, this target will fail any time we build with a different configuration. |
| 68 | + We delete the file so that the next build works fine. --> |
| 69 | + <Delete Condition=" '$(_SolutionTriplet)' != '$(VcpkgTriplet)' " Files="$(_TripletFile)" /> |
66 | 70 | <Error Condition=" '$(_SolutionTriplet)' != '$(VcpkgTriplet)' " |
67 | | - Text="The vcpkg triplet '$(VcpkgTriplet)' selected for project '$(MSBuildProjectName)' does not match with the solution triplet '$(_SolutionTriplet)'. If you are building from Visual Studio, try deleting the file '$(_TripletFile)'." /> |
| 71 | + Text="The vcpkg triplet '$(VcpkgTriplet)' selected for project '$(MSBuildProjectName)' does not match the recorded triplet '$(_SolutionTriplet)'. This may indicate a mismatch in the triplets used for current build configuration. If you have just changed the Configuration in Visual Studio, this error may be spurious and building again should properly check for mismatch." /> |
68 | 72 | </Target> |
69 | 73 | </Project> |
0 commit comments