summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2025-04-06 22:11:00 +0800
committerruki <[email protected]>2025-04-08 15:31:58 +0800
commit6d8671865bbe9026305186c54b4ef82ebb80a4bc (patch)
treea8bcb3a568481afde09d18adeba764d3ef528dfa /xmake/modules
parent43c3b8607775f7ee5b52e24a7f785b4c7a5ab292 (diff)
enable jobgraph for pch
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/private/action/build/object.lua1
-rw-r--r--xmake/modules/private/action/build/pcheader.lua6
2 files changed, 4 insertions, 3 deletions
diff --git a/xmake/modules/private/action/build/object.lua b/xmake/modules/private/action/build/object.lua
index 0028b4b6f..a8b66aa54 100644
--- a/xmake/modules/private/action/build/object.lua
+++ b/xmake/modules/private/action/build/object.lua
@@ -174,6 +174,7 @@ function _add_jobgraph(target, jobgraph, sourcebatch, opt)
end
function main(target, jobgraph, sourcebatch, opt)
+ opt = opt or {}
if jobgraph.add_orders then
_add_jobgraph(target, jobgraph, sourcebatch, opt)
else
diff --git a/xmake/modules/private/action/build/pcheader.lua b/xmake/modules/private/action/build/pcheader.lua
index 20e857d7f..ec06c8fb8 100644
--- a/xmake/modules/private/action/build/pcheader.lua
+++ b/xmake/modules/private/action/build/pcheader.lua
@@ -20,7 +20,7 @@
-- imports
import("core.language.language")
-import("object")
+import("object", {alias = "build_objects"})
function config(target, langkind, opt)
local pcheaderfile = target:pcheaderfile(langkind)
@@ -55,7 +55,7 @@ function config(target, langkind, opt)
end
-- add batch jobs to build the precompiled header file
-function build(target, langkind, opt)
+function build(target, jobgraph, langkind, opt)
local pcheaderfile = target:pcheaderfile(langkind)
if pcheaderfile then
local sourcefile = pcheaderfile
@@ -63,6 +63,6 @@ function build(target, langkind, opt)
local dependfile = target:dependfile(objectfile)
local sourcekind = language.langkinds()[langkind]
local sourcebatch = {sourcekind = sourcekind, sourcefiles = {sourcefile}, objectfiles = {objectfile}, dependfiles = {dependfile}}
- object.build(target, sourcebatch, opt)
+ build_objects(target, jobgraph, sourcebatch, opt)
end
end