diff options
| author | ruki <[email protected]> | 2024-10-08 23:13:31 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-10-08 23:13:31 +0800 |
| commit | aed4aaf6b1f2e3fdff7c69b320a9238ddb1ee3d8 (patch) | |
| tree | 30e878c74968c1295a49460cd9a8122135c9682e /xmake/rules/c++/modules/modules_support/builder.lua | |
| parent | 124e091f949eb35a47129086f8320eb8ae5bfcbd (diff) | |
| parent | 7106bb8cbfb98dd13c0a0481067e19aac60baf76 (diff) | |
Merge pull request #5686 from Arthapz/fix-module-scanning
Fix module scanning
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/builder.lua')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/builder.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/xmake/rules/c++/modules/modules_support/builder.lua b/xmake/rules/c++/modules/modules_support/builder.lua index f651e2b69..60e1112d8 100644 --- a/xmake/rules/c++/modules/modules_support/builder.lua +++ b/xmake/rules/c++/modules/modules_support/builder.lua @@ -21,6 +21,7 @@ -- imports import("core.base.json") import("core.base.option") +import("core.base.hashset") import("async.runjobs") import("private.async.buildjobs") import("core.tool.compiler") @@ -460,3 +461,23 @@ function add_headerunit_to_target_mapper(target, headerunit, bmifile) return deduplicated and true or false end +-- check if dependencies changed +function is_dependencies_changed(target, module) + local cachekey = target:name() .. module.name + local requires = hashset.from(table.keys(module.requires or {})) + local oldrequires = compiler_support.memcache():get2(cachekey, "oldrequires") + local changed = false + if oldrequires then + if oldrequires ~= requires then + requires_changed = true + else + for required in requires:items() do + if not oldrequires:has(required) then + requires_changed = true + break + end + end + end + end + return requires, changed +end |
