diff options
| author | ruki <[email protected]> | 2019-08-31 22:11:00 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-08-31 22:11:00 +0800 |
| commit | 9b62ca9a3bdccb9a37f80a6dd943dfd13a502a32 (patch) | |
| tree | 34f3b6fc417b0ec5cc73c722244527290f3a13d3 /xmake/plugins/project/clang/compile_flags.lua | |
| parent | e7ab648aa0bb953391204c6f081519421118e1d0 (diff) | |
fix all codes about sourcebatches
Diffstat (limited to 'xmake/plugins/project/clang/compile_flags.lua')
| -rw-r--r-- | xmake/plugins/project/clang/compile_flags.lua | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/xmake/plugins/project/clang/compile_flags.lua b/xmake/plugins/project/clang/compile_flags.lua index de557c818..d6205700d 100644 --- a/xmake/plugins/project/clang/compile_flags.lua +++ b/xmake/plugins/project/clang/compile_flags.lua @@ -48,21 +48,12 @@ function _make_object(target, sourcefile, objectfile) _g.firstline = false end --- make each objects -function _make_each_objects(target, sourcekind, sourcebatch) +-- make objects +function _make_objects(target, sourcekind, sourcebatch) for index, objectfile in ipairs(sourcebatch.objectfiles) do _make_object(target, sourcebatch.sourcefiles[index], objectfile) end end - --- make single object -function _make_single_object(target, sourcekind, sourcebatch) - - -- not supported now, ignore it directly - for _, sourcefile in ipairs(table.wrap(sourcebatch.sourcefiles)) do - cprint("${bright yellow}warning: ${default yellow}ignore[%s]: %s", target:name(), sourcefile) - end -end -- make target function _make_target(target) @@ -73,13 +64,10 @@ function _make_target(target) target:set("pcxxheader", nil) -- build source batches - for sourcekind, sourcebatch in pairs(target:sourcebatches()) do - if not sourcebatch.rulename then - if type(sourcebatch.objectfiles) == "string" then - _make_single_object(target, sourcekind, sourcebatch) - else - _make_each_objects(target, sourcekind, sourcebatch) - end + for _, sourcebatch in pairs(target:sourcebatches()) do + local sourcekind = sourcebatch.sourcekind + if sourcekind then + _make_objects(target, sourcekind, sourcebatch) end end end |
