Permalink
Browse files

Fixed the sorting of modules to also work with manually added depende…

…ncies.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
  • Loading branch information...
ddobrev committed Aug 20, 2017
1 parent 043aeb5 commit 27481289d6b3e16bc99db1681086c2175f31c8d0
Showing with 1 addition and 4 deletions.
  1. +1 −4 src/Generator/Driver.cs
@@ -222,9 +222,6 @@ public void BuildParseOptions()
public void SortModulesByDependencies()
{
if (!Options.DoAllModulesHaveLibraries())
return;
var sortedModules = Options.Modules.TopologicalSort(m =>
{
var dependencies = (from library in Context.Symbols.Libraries
@@ -235,7 +232,7 @@ where library.Dependencies.Intersect(module.Libraries).Any()
if (m != Options.SystemModule)
m.Dependencies.Add(Options.SystemModule);
m.Dependencies.AddRange(dependencies);
return dependencies;
return m.Dependencies;
});
Options.Modules.Clear();
Options.Modules.AddRange(sortedModules);

0 comments on commit 2748128

Please sign in to comment.