summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2022-08-07 02:36:46 +0200
committerArthur LAURENT <[email protected]>2022-08-07 02:36:46 +0200
commitc39a7060382929321332cf4fc3c00efa533ea758 (patch)
tree11dafa302ef5372df854bcd3970221228eeabd97 /xmake/rules/c++/modules/modules_support
parentf085566ba853eb16c8658da1a38caa3a5e5728d3 (diff)
Use target:add("xxflags") instead of passing a file
Diffstat (limited to 'xmake/rules/c++/modules/modules_support')
-rw-r--r--xmake/rules/c++/modules/modules_support/common.lua3
-rw-r--r--xmake/rules/c++/modules/modules_support/msvc.lua25
2 files changed, 22 insertions, 6 deletions
diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua
index e32637abf..aa1db3f0f 100644
--- a/xmake/rules/c++/modules/modules_support/common.lua
+++ b/xmake/rules/c++/modules/modules_support/common.lua
@@ -475,3 +475,6 @@ function build_modules_for_batchcmds(target, batchcmds, sourcebatch, modules, op
modules_support(target).build_modules_for_batchcmds(target, batchcmds, objectfiles, modules, opt)
end
+function append_headerunits_objectfiles(target)
+ modules_support(target).append_headerunits_objectfiles(target)
+end \ No newline at end of file
diff --git a/xmake/rules/c++/modules/modules_support/msvc.lua b/xmake/rules/c++/modules/modules_support/msvc.lua
index b54767ee6..1d946d339 100644
--- a/xmake/rules/c++/modules/modules_support/msvc.lua
+++ b/xmake/rules/c++/modules/modules_support/msvc.lua
@@ -94,12 +94,6 @@ function load(target)
target:add("cxxflags", {ifcsearchdirflag, cachedir}, {force = true, expand = false})
target:add("cxxflags", {ifcsearchdirflag, stlcachedir}, {force = true, expand = false})
target:add("cxxflags", {ifcsearchdirflag, path.join(stlcachedir, "experimental")}, {force = true, expand = false})
- target:add("cxxflags", "@" .. mapper_file, {force = true})
-
- local linker_file_flag = "@".. linker_file
- target:add("ldflags", linker_file_flag, {force = true})
- target:add("arflags", linker_file_flag, {force = true})
- target:add("shflags", linker_file_flag, {force = true})
-- add stdifcdir in case of if the user ask for it
if target:values("msvc.modules.stdifcdir") then
@@ -281,6 +275,11 @@ function build_modules_for_batchcmds(target, batchcmds, objectfiles, modules, op
local interfaceflag = get_interfaceflag(target)
local referenceflag = get_referenceflag(target)
+ -- add
+ for line in io.lines(mapper_file) do
+ target:add("cxxflags", line, {force = true})
+ end
+
-- build modules
local common_args = {"-TP"}
local depmtime = 0
@@ -458,3 +457,17 @@ function get_scandependenciesflag(target)
end
return scandependenciesflag or nil
end
+
+function append_headerunits_objectfiles(target)
+ local linker_file = _get_linker_argument_file()
+
+ for line in io.lines(linker_file) do
+ if target:kind() == "binary" then
+ target:add("ldflags", line, {force = true})
+ elseif target:kind() == "static" then
+ target:add("arflags", line, {force = true})
+ elseif target:kind() == "shared" then
+ target:add("shflags", line, {force = true})
+ end
+ end
+end \ No newline at end of file