summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/private/action/build/object.lua11
-rw-r--r--xmake/modules/private/action/build/pcheader.lua16
2 files changed, 13 insertions, 14 deletions
diff --git a/xmake/modules/private/action/build/object.lua b/xmake/modules/private/action/build/object.lua
index 423f7fdaa..4f953384c 100644
--- a/xmake/modules/private/action/build/object.lua
+++ b/xmake/modules/private/action/build/object.lua
@@ -91,6 +91,17 @@ function _build_object(target, sourcefile, opt)
end
end
+-- build the source files
+function build(target, sourcebatch, opt)
+ for i = 1, #sourcebatch.sourcefiles do
+ local sourcefile = sourcebatch.sourcefiles[i]
+ local objectfile = sourcebatch.objectfiles[i]
+ local dependfile = sourcebatch.dependfiles[i]
+ local sourcekind = assert(sourcebatch.sourcekind, "%s: sourcekind not found!", sourcefile)
+ _build_object(target, sourcefile, {objectfile = objectfile, dependfile = dependfile, sourcekind = sourcekind, progress = opt.progress})
+ end
+end
+
-- add batch jobs to build the source files
function main(target, batchjobs, sourcebatch, opt)
local rootjob = opt.rootjob
diff --git a/xmake/modules/private/action/build/pcheader.lua b/xmake/modules/private/action/build/pcheader.lua
index 48237dac9..c3753e928 100644
--- a/xmake/modules/private/action/build/pcheader.lua
+++ b/xmake/modules/private/action/build/pcheader.lua
@@ -22,27 +22,15 @@
import("core.language.language")
import("object")
--- build the precompiled header file
+-- add batch jobs to build the precompiled header file
function main(target, langkind, opt)
-
- -- get the precompiled header
local pcheaderfile = target:pcheaderfile(langkind)
if pcheaderfile then
-
- -- init sourcefile, objectfile and dependfile
local sourcefile = pcheaderfile
local objectfile = target:pcoutputfile(langkind)
local dependfile = target:dependfile(objectfile)
local sourcekind = language.langkinds()[langkind]
-
- -- init source batch
local sourcebatch = {sourcekind = sourcekind, sourcefiles = {sourcefile}, objectfiles = {objectfile}, dependfiles = {dependfile}}
-
- -- build this precompiled header
- local progress = opt.progress
- if type(progress) == "number" then
- progress = {start = progress, stop = progress}
- end
- object(target, sourcebatch, {progress = progress})
+ object.build(target, sourcebatch, opt)
end
end