diff options
| author | ruki <[email protected]> | 2017-07-20 09:12:39 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-07-20 09:12:39 +0800 |
| commit | 1df9b001b1607882d38211ddb2e6d72e3ac0c542 (patch) | |
| tree | 8c1c843ddeb77537019d42f76843d0ce18c23198 | |
| parent | f8bd23369f5a3fd8d8cec2775bed850379be335a (diff) | |
optimize rebuild speed
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | xmake/actions/build/builder.lua | 5 | ||||
| -rw-r--r-- | xmake/actions/build/kinds/binary.lua | 2 | ||||
| -rw-r--r-- | xmake/actions/build/kinds/object.lua | 2 | ||||
| -rw-r--r-- | xmake/actions/build/kinds/shared.lua | 2 | ||||
| -rw-r--r-- | xmake/actions/build/kinds/static.lua | 2 | ||||
| -rw-r--r-- | xmake/actions/build/main.lua | 5 |
7 files changed, 11 insertions, 9 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f1377a4c..28555f510 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ * [#129](https://github.com/tboox/xmake/issues/129): Check link deps and cache the target file * Support `*.asm` source files for vs201x project plugin * Mark `add_bindings` and `add_rbindings` as deprecated +* Optimize `xmake rebuild` speed on windows ### Bugs fixed @@ -348,6 +349,7 @@ * [#129](https://github.com/tboox/xmake/issues/129): 检测链接依赖,如果源文件没有改变,就不必重新链接目标文件了 * 在vs201x工程插件中增加对`*.asm`文件的支持 * 标记`add_bindings`和`add_rbindings`为废弃接口 +* 优化`xmake rebuild`在windows上的构建速度 ### Bugs修复 diff --git a/xmake/actions/build/builder.lua b/xmake/actions/build/builder.lua index d8a4e4185..8078a23ce 100644 --- a/xmake/actions/build/builder.lua +++ b/xmake/actions/build/builder.lua @@ -124,7 +124,7 @@ function _stat_target_count(targetname) end -- build -function build(targetname) +function build(targetname, rebuild) -- enter toolchains environment environment.enter("toolchains") @@ -132,6 +132,9 @@ function build(targetname) -- stat targets count _stat_target_count(targetname) + -- mark as rebuild + _g.rebuild = rebuild + -- clear finished states _g.finished = {} diff --git a/xmake/actions/build/kinds/binary.lua b/xmake/actions/build/kinds/binary.lua index fb69ac246..5f4a31736 100644 --- a/xmake/actions/build/kinds/binary.lua +++ b/xmake/actions/build/kinds/binary.lua @@ -35,7 +35,7 @@ function _build_from_objects(target, buildinfo) object.build(target, buildinfo) -- this target and it's deps are not modified? - local modified = buildinfo.modified[target:name()] + local modified = buildinfo.rebuild or buildinfo.modified[target:name()] if not modified then for _, depname in ipairs(target:get("deps")) do modified = buildinfo.modified[depname] diff --git a/xmake/actions/build/kinds/object.lua b/xmake/actions/build/kinds/object.lua index 57e87236c..24429d251 100644 --- a/xmake/actions/build/kinds/object.lua +++ b/xmake/actions/build/kinds/object.lua @@ -136,7 +136,7 @@ function _build_object(target, buildinfo, index, sourcebatch, ccache) end -- we need not rebuild it if the files are not modified - if not modified then + if not modified and not buildinfo.rebuild then return end diff --git a/xmake/actions/build/kinds/shared.lua b/xmake/actions/build/kinds/shared.lua index d7b6b95dd..0b47b4684 100644 --- a/xmake/actions/build/kinds/shared.lua +++ b/xmake/actions/build/kinds/shared.lua @@ -35,7 +35,7 @@ function _build_from_objects(target, buildinfo) object.build(target, buildinfo) -- this target and it's deps are not modified? - local modified = buildinfo.modified[target:name()] + local modified = buildinfo.rebuild or buildinfo.modified[target:name()] if not modified then for _, depname in ipairs(target:get("deps")) do modified = buildinfo.modified[depname] diff --git a/xmake/actions/build/kinds/static.lua b/xmake/actions/build/kinds/static.lua index 2f344d3c9..c767908fe 100644 --- a/xmake/actions/build/kinds/static.lua +++ b/xmake/actions/build/kinds/static.lua @@ -35,7 +35,7 @@ function _build_from_objects(target, buildinfo) object.build(target, buildinfo) -- this target and it's deps are not modified? - local modified = buildinfo.modified[target:name()] + local modified = buildinfo.rebuild or buildinfo.modified[target:name()] if not modified then for _, depname in ipairs(target:get("deps")) do modified = buildinfo.modified[depname] diff --git a/xmake/actions/build/main.lua b/xmake/actions/build/main.lua index eeeeb2318..e29645d14 100644 --- a/xmake/actions/build/main.lua +++ b/xmake/actions/build/main.lua @@ -50,9 +50,6 @@ function main() -- mark as rebuild rebuild = true - -- clean it first - task.run("clean", {target = targetname}) - -- reset state cache.set("rebuild", nil) end @@ -69,7 +66,7 @@ function main() function () -- build - builder.build(targetname) + builder.build(targetname, rebuild) end, catch |
