summaryrefslogtreecommitdiff
path: root/xmake/core/tool/compiler.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-10-28 00:30:49 +0800
committerruki <[email protected]>2021-10-28 00:30:49 +0800
commitd527a9213c3ac1651dc7f7bea7a2ea91139ed6ff (patch)
tree73db098b17059a3972c7ea0d605a0dc2415f6cdf /xmake/core/tool/compiler.lua
parent811a0d8dccbf758acdb074cbca736dcafc4590d7 (diff)
fix compiler
Diffstat (limited to 'xmake/core/tool/compiler.lua')
-rw-r--r--xmake/core/tool/compiler.lua32
1 files changed, 16 insertions, 16 deletions
diff --git a/xmake/core/tool/compiler.lua b/xmake/core/tool/compiler.lua
index 0e64de8c3..3aa2a8e6c 100644
--- a/xmake/core/tool/compiler.lua
+++ b/xmake/core/tool/compiler.lua
@@ -74,6 +74,22 @@ function compiler:_add_flags_from_compiler(flags, targetkind)
end
end
+-- add flags from the sourcefile config
+function compiler:_add_flags_from_fileconfig(flags, target, sourcefile, fileconfig)
+
+ -- add flags from the current compiler
+ local add_sourceflags = self:_tool().add_sourceflags
+ if add_sourceflags then
+ local flag = add_sourceflags(self:_tool(), sourcefile, fileconfig, target, self:_targetkind())
+ if flag and flag ~= "" then
+ table.join2(flags, flag)
+ end
+ end
+
+ -- add flags from the common argument option
+ self:_add_flags_from_argument(flags, target, fileconfig)
+end
+
-- load compiler tool
function compiler._load_tool(sourcekind, target)
@@ -262,22 +278,6 @@ function compiler:compcmd(sourcefiles, objectfile, opt)
return os.args(table.join(self:compargv(sourcefiles, objectfile, opt)))
end
--- add flags from the sourcefile config
-function builder:_add_flags_from_fileconfig(flags, target, sourcefile, fileconfig)
-
- -- add flags from the current compiler
- local add_sourceflags = self:_tool().add_sourceflags
- if add_sourceflags then
- local flag = add_sourceflags(self:_tool(), sourcefile, fileconfig, target, self:_targetkind())
- if flag and flag ~= "" then
- table.join2(flags, flag)
- end
- end
-
- -- add flags from the common argument option
- self:_add_flags_from_argument(flags, target, fileconfig)
-end
-
-- get the compling flags
--
-- @param opt the argument options (contain all the compiler attributes of target),