diff options
| author | ruki <[email protected]> | 2021-10-28 00:30:49 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-10-28 00:30:49 +0800 |
| commit | d527a9213c3ac1651dc7f7bea7a2ea91139ed6ff (patch) | |
| tree | 73db098b17059a3972c7ea0d605a0dc2415f6cdf | |
| parent | 811a0d8dccbf758acdb074cbca736dcafc4590d7 (diff) | |
fix compiler
| -rw-r--r-- | xmake/core/tool/compiler.lua | 32 |
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), |
