diff options
| author | ruki <[email protected]> | 2015-12-25 11:20:45 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-12-25 11:20:45 +0800 |
| commit | 3ab31ee7ce09cfb58a3058fb7653991618b2e895 (patch) | |
| tree | 3a30d33d9047fc31478e1e675782c1cc18d447f0 /xmake/scripts/base/compiler.lua | |
| parent | 757741ef501c2160d08b33dbdfa50ed59a6b7b6a (diff) | |
fix compile error for share library
Diffstat (limited to 'xmake/scripts/base/compiler.lua')
| -rw-r--r-- | xmake/scripts/base/compiler.lua | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/xmake/scripts/base/compiler.lua b/xmake/scripts/base/compiler.lua index 530c70a29..ab6ee1960 100644 --- a/xmake/scripts/base/compiler.lua +++ b/xmake/scripts/base/compiler.lua @@ -112,14 +112,21 @@ function compiler._getflags(module, names, flags) end -- add flags from the compiler -function compiler._addflags_from_compiler(module, flags, flagnames) +function compiler._addflags_from_compiler(module, flags, flagnames, kind) -- check assert(module and flags and flagnames) -- done for _, flagname in ipairs(flagnames) do + + -- add compiler.xxflags table.join2(flags, module, module[flagname]) + + -- add compiler.kind.xxflags + if kind ~= nil and module[kind] ~= nil then + table.join2(flags, module, module[kind][flagname]) + end end end @@ -374,6 +381,9 @@ function compiler._make_for_option(module, opt, srcfile, objfile, logfile) -- add flags from the compiler compiler._addflags_from_compiler(module, flags, flagnames) + -- remove repeat + flags = utils.unique(flags) + -- execute the compile command return module:command_compile(srcfile, objfile, table.concat(flags, " "):trim(), logfile) end @@ -429,7 +439,10 @@ function compiler.make(module, target, srcfile, objfile, logfile) compiler._addflags_from_platform(module, flags, flagnames) -- add flags from the compiler - compiler._addflags_from_compiler(module, flags, flagnames) + compiler._addflags_from_compiler(module, flags, flagnames, target.kind) + + -- remove repeat + flags = utils.unique(flags) -- make the compile command return module:command_compile(srcfile, objfile, table.concat(flags, " "):trim(), logfile) |
