diff options
author | Miguel de Icaza <miguel@gnome.org> | 2016-05-18 22:19:16 +0300 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2016-05-18 22:19:27 +0300 |
commit | 6cf2c991e907246a209442026ed904cc96d50279 (patch) | |
tree | 25629c7807e76e59bb7be922504fc8d39e9846b1 /msvc/scripts/genproj.cs | |
parent | 3fc2fee18d61305b6b63b61f47c059dc2d5f058a (diff) |
genproj: Improve handling of executables and projects with build dependencies
Diffstat (limited to 'msvc/scripts/genproj.cs')
-rw-r--r-- | msvc/scripts/genproj.cs | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/msvc/scripts/genproj.cs b/msvc/scripts/genproj.cs index e220a95a506..1d15e761eb3 100644 --- a/msvc/scripts/genproj.cs +++ b/msvc/scripts/genproj.cs @@ -831,19 +831,19 @@ class MsbuildGenerator { // <Name>System-basic</Name> //</ProjectReference> var refdistinct = references.Distinct (); - foreach (string r in refdistinct) { + foreach (string reference in refdistinct) { - var match = GetMatchingCsproj (r, projects); + var match = GetMatchingCsproj (reference, projects); if (match != null) { - AddProjectReference (refs, Csproj, match, r, null); + AddProjectReference (refs, Csproj, match, reference, null); } else { if (showWarnings){ - Console.WriteLine ("{0}: Could not find a matching project reference for {1}", library, Path.GetFileName (r)); + Console.WriteLine ("{0}: Could not find a matching project reference for {1}", library, Path.GetFileName (reference)); Console.WriteLine (" --> Adding reference with hintpath instead"); } - refs.Append (" <Reference Include=\"" + r + "\">" + NewLine); + refs.Append (" <Reference Include=\"" + reference + "\">" + NewLine); refs.Append (" <SpecificVersion>False</SpecificVersion>" + NewLine); - refs.Append (" <HintPath>" + r + "</HintPath>" + NewLine); + refs.Append (" <HintPath>" + reference + "</HintPath>" + NewLine); refs.Append (" <Private>False</Private>" + NewLine); refs.Append (" </Reference>" + NewLine); } @@ -965,7 +965,7 @@ class MsbuildGenerator { { // libDir would be "./../../class/lib/net_4_x for example // project - if (!dllReferenceName.EndsWith (".dll")) + if (!dllReferenceName.EndsWith (".dll") && !dllReferenceName.EndsWith (".exe")) dllReferenceName += ".dll"; var probe = Path.GetFullPath (Path.Combine (base_dir, dllReferenceName)); @@ -985,6 +985,13 @@ class MsbuildGenerator { return project.Value; } } + + // Last attempt, try to find the library in all the projects + foreach (var project in projects) { + if (project.Value.AbsoluteLibraryOutput.EndsWith (dllReferenceName)) + return project.Value; + + } Console.WriteLine ("Did not find referenced {0} with libs={1}", dllReferenceName, String.Join (", ", libs)); foreach (var p in projects) { // Console.WriteLine ("{0}", p.Value.AbsoluteLibraryOutput); @@ -1004,6 +1011,7 @@ public class Driver { string library = project.Attribute ("library").Value; var profile = project.Element ("profile").Value; +#if true // Skip facades for now, the tool doesn't know how to deal with them yet. if (dir.Contains ("Facades")) continue; @@ -1023,7 +1031,7 @@ public class Driver { yield return project; continue; } - +#endif // // Do not do 2.1, it is not working yet // Do not do basic, as there is no point (requires a system mcs to be installed). @@ -1034,9 +1042,11 @@ public class Driver { // The next ones are to make debugging easier for now if (profile == "basic") continue; +#if true if (profile != "net_4_x" || library.Contains ("tests")) continue; - +#endif + //Console.WriteLine ("Going to handle {0}", library); yield return project; } } @@ -1078,6 +1088,7 @@ public class Driver { } foreach (var project in GetProjects (makefileDeps)){ var library_output = project.Element ("library_output").Value; + Console.WriteLine ("=== {0} ===", library_output); var gen = projects [library_output]; try { var csproj = gen.Generate (projects); @@ -1131,7 +1142,7 @@ public class Driver { // A few other optional solutions // Solutions with 'everything' and the most common libraries used in development may be of interest - //WriteSolution (sln_gen, "mcs_full.sln"); + //WriteSolution (sln_gen, "./mcs_full.sln"); //WriteSolution (small_full_sln_gen, "small_full.sln"); // The following may be useful if lacking visual studio or MonoDevelop, to bootstrap mono compiler self-hosting //WriteSolution (basic_sln_gen, "mcs_basic.sln"); |