summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/actions/build/builder.lua3
-rw-r--r--xmake/actions/build/kinds/binary.lua15
-rw-r--r--xmake/actions/build/kinds/object.lua4
-rw-r--r--xmake/actions/build/kinds/shared.lua15
-rw-r--r--xmake/actions/build/kinds/static.lua15
5 files changed, 41 insertions, 11 deletions
diff --git a/xmake/actions/build/builder.lua b/xmake/actions/build/builder.lua
index df4ed8322..d8a4e4185 100644
--- a/xmake/actions/build/builder.lua
+++ b/xmake/actions/build/builder.lua
@@ -135,6 +135,9 @@ function build(targetname)
-- clear finished states
_g.finished = {}
+ -- clear modified states
+ _g.modified = {}
+
-- init target index
_g.targetindex = 0
diff --git a/xmake/actions/build/kinds/binary.lua b/xmake/actions/build/kinds/binary.lua
index 52baad2a3..78ca5996d 100644
--- a/xmake/actions/build/kinds/binary.lua
+++ b/xmake/actions/build/kinds/binary.lua
@@ -34,9 +34,18 @@ function _build_from_objects(target, buildinfo)
-- build objects
object.build(target, buildinfo)
- -- the object files are not modified?
- if not buildinfo.objects_modified then
- return
+ -- this target and it's deps are not modified?
+ local modified = buildinfo.modified[target:name()]
+ if not modified then
+ for _, depname in ipairs(target:get("deps")) do
+ modified = buildinfo.modified[depname]
+ if modified then
+ break
+ end
+ end
+ if not modified then
+ return
+ end
end
-- expand object files with *.o/obj
diff --git a/xmake/actions/build/kinds/object.lua b/xmake/actions/build/kinds/object.lua
index 513cb2b9e..4acb9f863 100644
--- a/xmake/actions/build/kinds/object.lua
+++ b/xmake/actions/build/kinds/object.lua
@@ -140,8 +140,8 @@ function _build_object(target, buildinfo, index, sourcebatch, ccache)
return
end
- -- the object files are modified
- buildinfo.objects_modified = true
+ -- mark this target as modified
+ buildinfo.modified[target:name()] = true
-- is verbose?
local verbose = option.get("verbose")
diff --git a/xmake/actions/build/kinds/shared.lua b/xmake/actions/build/kinds/shared.lua
index d4fa90257..3cbcea9c8 100644
--- a/xmake/actions/build/kinds/shared.lua
+++ b/xmake/actions/build/kinds/shared.lua
@@ -34,9 +34,18 @@ function _build_from_objects(target, buildinfo)
-- build objects
object.build(target, buildinfo)
- -- the object files are not modified?
- if not buildinfo.objects_modified then
- return
+ -- this target and it's deps are not modified?
+ local modified = buildinfo.modified[target:name()]
+ if not modified then
+ for _, depname in ipairs(target:get("deps")) do
+ modified = buildinfo.modified[depname]
+ if modified then
+ break
+ end
+ end
+ if not modified then
+ return
+ end
end
-- make headers
diff --git a/xmake/actions/build/kinds/static.lua b/xmake/actions/build/kinds/static.lua
index 9b73742a3..9682c3846 100644
--- a/xmake/actions/build/kinds/static.lua
+++ b/xmake/actions/build/kinds/static.lua
@@ -34,9 +34,18 @@ function _build_from_objects(target, buildinfo)
-- build objects
object.build(target, buildinfo)
- -- the object files are not modified?
- if not buildinfo.objects_modified then
- return
+ -- this target and it's deps are not modified?
+ local modified = buildinfo.modified[target:name()]
+ if not modified then
+ for _, depname in ipairs(target:get("deps")) do
+ modified = buildinfo.modified[depname]
+ if modified then
+ break
+ end
+ end
+ if not modified then
+ return
+ end
end
-- make headers