diff options
| author | Arthur LAURENT <[email protected]> | 2022-08-17 19:48:26 +0200 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2022-08-17 20:59:28 +0200 |
| commit | df539bcf1be21855f4b837830f00e3e11bcea9d2 (patch) | |
| tree | e98ae630e786990ee296c2ee5482266d78ebfcd7 /xmake/rules/c++/modules/modules_support/common.lua | |
| parent | dfba8ae1f44afb2dccdb0b0058d1e9b9d46192ed (diff) | |
improve headerunit resolution and shared library support on msvc
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 aa7c0fb59..109c48386 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 @@ -479,7 +479,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 @@ -542,14 +541,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 |
