summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md2
-rw-r--r--xmake/actions/build/kinds/binary.lua5
-rw-r--r--xmake/actions/build/kinds/object.lua3
-rw-r--r--xmake/actions/build/kinds/shared.lua5
-rw-r--r--xmake/actions/build/kinds/static.lua5
5 files changed, 20 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dcd4a3ed7..11327afc0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -27,6 +27,7 @@
* Improve to detect vstudio sdk and cross toolchains envirnoment
* [#71](https://github.com/tboox/xmake/issues/71): Improve to detect compiler and linker from env vars
* Improve the option detection (cache and multi-jobs) and increase 70% speed
+* [#129](https://github.com/tboox/xmake/issues/129): Check link deps and cache the target file
### Bugs fixed
@@ -330,6 +331,7 @@
* 改进vstudio环境和交叉工具链的探测
* [#71](https://github.com/tboox/xmake/issues/71): 改进从环境变量中探测链接器和编译器
* 改进option选项检测,通过多任务检测,提升70%的检测速度
+* [#129](https://github.com/tboox/xmake/issues/129): 检测链接依赖,如果源文件没有改变,就不必重新链接目标文件了
### Bugs修复
diff --git a/xmake/actions/build/kinds/binary.lua b/xmake/actions/build/kinds/binary.lua
index 17d4e063c..52baad2a3 100644
--- a/xmake/actions/build/kinds/binary.lua
+++ b/xmake/actions/build/kinds/binary.lua
@@ -34,6 +34,11 @@ 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
+ end
+
-- expand object files with *.o/obj
local objectfiles = {}
for _, objectfile in ipairs(target:objectfiles()) do
diff --git a/xmake/actions/build/kinds/object.lua b/xmake/actions/build/kinds/object.lua
index 0e808ab0c..513cb2b9e 100644
--- a/xmake/actions/build/kinds/object.lua
+++ b/xmake/actions/build/kinds/object.lua
@@ -140,6 +140,9 @@ function _build_object(target, buildinfo, index, sourcebatch, ccache)
return
end
+ -- the object files are modified
+ buildinfo.objects_modified = 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 158b71ccf..d4fa90257 100644
--- a/xmake/actions/build/kinds/shared.lua
+++ b/xmake/actions/build/kinds/shared.lua
@@ -34,6 +34,11 @@ 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
+ end
+
-- make headers
local srcheaders, dstheaders = target:headerfiles()
if srcheaders and dstheaders then
diff --git a/xmake/actions/build/kinds/static.lua b/xmake/actions/build/kinds/static.lua
index a4971cd7f..9b73742a3 100644
--- a/xmake/actions/build/kinds/static.lua
+++ b/xmake/actions/build/kinds/static.lua
@@ -34,6 +34,11 @@ 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
+ end
+
-- make headers
local srcheaders, dstheaders = target:headerfiles()
if srcheaders and dstheaders then