|
637 | 637 | -- topological sort |
638 | 638 | function sort_modules_by_dependencies(target, modules) |
639 | 639 |
|
640 | | - local changed = support.memcache():get2(target:fullname(), "modules.changed") |
641 | | - if changed then |
| 640 | + local memcache = support.memcache() |
| 641 | + local localcache = support.localcache() |
| 642 | + local changed = memcache:get2(target:fullname(), "modules.changed") |
| 643 | + local built_artifacts = localcache:get2(target:fullname(), "c++.modules.built_artifacts") |
| 644 | + if changed or not built_artifacts then |
642 | 645 | local built_modules = {} |
643 | 646 | local built_headerunits = {} |
644 | 647 | local objectfiles = {} |
@@ -751,11 +754,12 @@ function sort_modules_by_dependencies(target, modules) |
751 | 754 | table.sort(objectfiles) |
752 | 755 | built_headerunits = table.unique(built_headerunits) |
753 | 756 |
|
754 | | - support.localcache():set2(target:fullname(), "c++.modules.built_artifacts", {modules = built_modules, headerunits = built_headerunits, objectfiles = objectfiles}) |
755 | | - support.localcache():save() |
756 | | - support.memcache():set2(target:fullname(), "modules.changed", false) |
| 757 | + built_artifacts = {modules = built_modules, headerunits = built_headerunits, objectfiles = objectfiles} |
| 758 | + localcache:set2(target:fullname(), "c++.modules.built_artifacts", built_artifacts) |
| 759 | + localcache:save() |
| 760 | + memcache:set2(target:fullname(), "modules.changed", false) |
757 | 761 | end |
758 | | - local built_artifacts = support.localcache():get2(target:fullname(), "c++.modules.built_artifacts") |
| 762 | + assert(built_artifacts, "shouldn't assert here, please open an issue") |
759 | 763 | return built_artifacts.modules, built_artifacts.headerunits, built_artifacts.objectfiles |
760 | 764 | end |
761 | 765 |
|
|
0 commit comments