summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
Diffstat (limited to 'xmake')
-rw-r--r--xmake/core/base/graph.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/xmake/core/base/graph.lua b/xmake/core/base/graph.lua
index c4b28cd37..86746dfa9 100644
--- a/xmake/core/base/graph.lua
+++ b/xmake/core/base/graph.lua
@@ -127,9 +127,11 @@ function graph:topological_sort()
table.insert(order_vertices, v)
end
for _, v in ipairs(self:vertices()) do
- graph_topological_sort_dfs(v)
+ if marked[v] == false then
+ graph_topological_sort_dfs(v)
+ end
end
- return order_vertices
+ return table.reverse(order_vertices)
end
-- get edges