diff options
| author | ruki <[email protected]> | 2022-08-18 08:53:03 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-08-18 08:53:03 +0800 |
| commit | a7558af4029f5d08fe4ded8fa3bca3d7f7a43798 (patch) | |
| tree | d3e81d3ec83f413b4d8d38be8af4dc20cfc4c69c /xmake/rules/c++/modules/modules_support/common.lua | |
| parent | 41c70cef65f4f82e718924ae934dd6323d5b60ad (diff) | |
| parent | df539bcf1be21855f4b837830f00e3e11bcea9d2 (diff) | |
Merge pull request #2680 from Arthapz/cxxmodules
Improve MSVC module code
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/common.lua')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/common.lua | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua index 138c8e36f..580d52dd9 100644 --- a/xmake/rules/c++/modules/modules_support/common.lua +++ b/xmake/rules/c++/modules/modules_support/common.lua @@ -71,12 +71,12 @@ function get_headerunits(target, sourcebatch, modules) if stl_headers.is_stl_header(name) then stl_headerunits = stl_headerunits or {} if not table.find_if(stl_headerunits, function(i, v) return v.name == name end) then - table.insert(stl_headerunits, {name = name, path = r.path, type = unittype}) + table.insert(stl_headerunits, {name = name, path = r.path, type = unittype, unique = r.unique}) end else headerunits = headerunits or {} if not table.find_if(headerunits, function(i, v) return v.name == name end) then - table.insert(headerunits, {name = name, path = r.path, type = unittype}) + table.insert(headerunits, {name = name, path = r.path, type = unittype, unique = r.unique}) end end end @@ -482,7 +482,6 @@ function generate_headerunits_for_batchcmds(target, batchcmds, sourcebatch, modu -- generate headerunits -- build stl header units as other headerunits may need them if stl_headerunits or user_headerunits then - local headerunits_flags = localcache():get("headerunits_flags") if stl_headerunits then modules_support(target).generate_stl_headerunits_for_batchcmds(target, batchcmds, stl_headerunits, opt) end @@ -545,14 +544,16 @@ function build_modules_for_batchcmds(target, batchcmds, sourcebatch, modules, op end -- append headerunits objectfiles to link -function append_headerunits_objectfiles(target) - local cachekey = target:name() .. "headerunit_objectfiles" - local cache = localcache():get(cachekey) or {} - if target:is_binary() then - target:add("ldflags", cache, {force = true}) - elseif target:is_static() then - target:add("arflags", cache, {force = true}) - elseif target:is_shared() then - target:add("shflags", cache, {force = true}) +function append_dependency_objectfiles(target) + local cachekey = target:name() .. "dependency_objectfiles" + local cache = localcache():get(cachekey) + if cache then + if target:is_binary() then + target:add("ldflags", cache, {force = true}) + elseif target:is_static() then + target:add("arflags", cache, {force = true}) + elseif target:is_shared() then + target:add("shflags", cache, {force = true}) + end end end |
