diff options
author | Katelyn Gadd <kg@luminance.org> | 2018-08-02 01:30:54 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2018-08-02 01:30:54 +0300 |
commit | feaf8ee391a09fbff2137905ac7139f9bacc99fa (patch) | |
tree | 454454ea017e91e470c79d61cf87fd63bc0ba3d3 /msvc/scripts | |
parent | 09c0cc5fca642a2c9f3f8d2ef086b9d4e7e9ee0b (diff) |
Use msbuild project reference to establish dependency on genconsts instead of solution dependencies (#9670)
Using solution dependencies in ```bcl.sln``` seems flaky and seems like it might not establish the full ordering we need to ensure that ```Consts.cs``` exists before we build things that require it. Let's try using project references (where ```corlib.dll``` 'depends' on ```genconsts.exe```) instead. This should also insert the dependency for any project that includes Consts.cs instead of just corlib.
This PR also makes update-solution-files actually fail if ```genconsts.exe``` fails to build because it was driving me mad.
Part of #6886
Diffstat (limited to 'msvc/scripts')
-rw-r--r-- | msvc/scripts/Makefile | 3 | ||||
-rwxr-xr-x | msvc/scripts/genproj.cs | 14 |
2 files changed, 15 insertions, 2 deletions
diff --git a/msvc/scripts/Makefile b/msvc/scripts/Makefile index 49b7329bb6c..aae608c6f95 100644 --- a/msvc/scripts/Makefile +++ b/msvc/scripts/Makefile @@ -2,7 +2,8 @@ all: genproj.exe prepare.exe mono --debug genproj.exe genproj.exe: genproj.cs ../../mcs/build/gensources.cs - csc -debug:portable genproj.cs ../../mcs/build/gensources.cs -main:Driver -r:System.dll -r:System.Core.dll + -rm $@ + csc -debug:portable genproj.cs ../../mcs/build/gensources.cs -main:Driver -r:System.dll -r:System.Core.dll -out:$@ prepare.exe: prepare.cs csc prepare.cs diff --git a/msvc/scripts/genproj.cs b/msvc/scripts/genproj.cs index 86794ed0ef5..84e256e1550 100755 --- a/msvc/scripts/genproj.cs +++ b/msvc/scripts/genproj.cs @@ -229,7 +229,6 @@ public class MsbuildGenerator { }; public static readonly (string, string[])[] fixed_dependencies = new [] { - ("corlib/corlib.csproj", new [] { SlnGenerator.genconsts_csproj_guid }), ("class/System.Web/System.Web.csproj", new [] { culevel_guid }) }; @@ -884,9 +883,22 @@ public class MsbuildGenerator { } ).ToList (); + result.Append ($" <ItemGroup>{NewLine}"); foreach (var file in commonFiles.OrderBy (f => f, StringComparer.Ordinal)) result.Append ($" <Compile Include=\"{file}\" />{NewLine}"); + + if (commonFiles.Any (f => f.EndsWith("build\\common\\Consts.cs"))) { + var genconstsRelativePath = "$(SolutionDir)\\msvc\\scripts\\genconsts.csproj"; + result.Append ($" <ProjectReference Include=\"{genconstsRelativePath}\">{NewLine}"); + result.Append ($" <Name>genconsts</Name>"); + result.Append ($" <Project>{SlnGenerator.genconsts_csproj_guid}</Project>"); + result.Append ($" <ReferenceOutputAssembly>false</ReferenceOutputAssembly>"); + result.Append ($" <CopyToOutputDirectory>Never</CopyToOutputDirectory>"); + result.Append ($" <Private>False</Private>"); + result.Append ($" </ProjectReference>{NewLine}"); + } + result.Append ($" </ItemGroup>{NewLine}"); foreach (var set in targetFileSets) { |