summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
authorruki <[email protected]>2017-11-11 21:23:57 +0800
committerruki <[email protected]>2017-11-11 21:23:57 +0800
commitf50cc8971ad01966cb5bfbcd2bef354fdef42cd8 (patch)
tree69c6f0123120175998b581d362a568b3999f9f1b /xmake/plugins
parentd8c3db4f8bd8a63eb1748bf1e0fd90001e318668 (diff)
improve project plugin
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/project/clang/compile_commands.lua10
-rw-r--r--xmake/plugins/project/makefile/makefile.lua21
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua4
3 files changed, 18 insertions, 17 deletions
diff --git a/xmake/plugins/project/clang/compile_commands.lua b/xmake/plugins/project/clang/compile_commands.lua
index 9c9ebea16..b805f188c 100644
--- a/xmake/plugins/project/clang/compile_commands.lua
+++ b/xmake/plugins/project/clang/compile_commands.lua
@@ -85,10 +85,12 @@ function _make_target(jsonfile, target)
-- build source batches
for sourcekind, sourcebatch in pairs(target:sourcebatches()) do
- if type(sourcebatch.objectfiles) == "string" then
- _make_single_object(jsonfile, target, sourcekind, sourcebatch)
- else
- _make_each_objects(jsonfile, target, sourcekind, sourcebatch)
+ if not sourcebatch.rulename then
+ if type(sourcebatch.objectfiles) == "string" then
+ _make_single_object(jsonfile, target, sourcekind, sourcebatch)
+ else
+ _make_each_objects(jsonfile, target, sourcekind, sourcebatch)
+ end
end
end
end
diff --git a/xmake/plugins/project/makefile/makefile.lua b/xmake/plugins/project/makefile/makefile.lua
index 7f50d569a..d4061359f 100644
--- a/xmake/plugins/project/makefile/makefile.lua
+++ b/xmake/plugins/project/makefile/makefile.lua
@@ -306,16 +306,13 @@ function _make_target(makefile, target)
-- build source batches
for sourcekind, sourcebatch in pairs(target:sourcebatches()) do
-
- -- compile source files to single object at the same time?
- if type(sourcebatch.objectfiles) == "string" then
-
- -- make single object
- _make_single_object(makefile, target, sourcekind, sourcebatch)
- else
-
- -- make each objects
- _make_each_objects(makefile, target, sourcekind, sourcebatch)
+ if not sourcebatch.rulename then
+ -- compile source files to single object at once
+ if type(sourcebatch.objectfiles) == "string" then
+ _make_single_object(makefile, target, sourcekind, sourcebatch)
+ else
+ _make_each_objects(makefile, target, sourcekind, sourcebatch)
+ end
end
end
end
@@ -359,7 +356,9 @@ function _make_all(makefile)
for targetname, target in pairs(project.targets()) do
if not target:isphony() then
for sourcekind, sourcebatch in pairs(target:sourcebatches()) do
- makefile:print("%s_%s=%s", targetname, sourcekind:upper(), os.args(compiler.compflags(sourcebatch.sourcefiles, {target = target, sourcekind = sourcekind})))
+ if not sourcebatch.rulename then
+ makefile:print("%s_%s=%s", targetname, sourcekind:upper(), os.args(compiler.compflags(sourcebatch.sourcefiles, {target = target, sourcekind = sourcekind})))
+ end
end
makefile:print("%s_%s=%s", targetname, target:linker():kind():upper(), os.args(target:linkflags()))
end
diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
index 7277d6ed3..687339b45 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
@@ -408,7 +408,7 @@ function _make_common_items(vcxprojfile, vsinfo, target, vcxprojdir)
local first_flags = nil
targetinfo.sourceflags = {}
for sourcekind, sourcebatch in pairs(targetinfo.sourcebatches) do
- if sourcekind == "cc" or sourcekind == "cxx" or sourcekind == "as" then
+ if not sourcebatch.rulename and (sourcekind == "cc" or sourcekind == "cxx" or sourcekind == "as") then
for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
-- make compiler flags
@@ -650,7 +650,7 @@ function _make_source_files(vcxprojfile, vsinfo, target, vcxprojdir)
local sourceinfos = {}
for _, targetinfo in ipairs(target.info) do
for sourcekind, sourcebatch in pairs(targetinfo.sourcebatches) do
- if sourcekind == "cc" or sourcekind == "cxx" or sourcekind == "as" then
+ if not sourcebatch.rulename and (sourcekind == "cc" or sourcekind == "cxx" or sourcekind == "as") then
local objectfiles = sourcebatch.objectfiles
for idx, sourcefile in ipairs(sourcebatch.sourcefiles) do
local objectfile = objectfiles[idx]