summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-08-03 18:06:40 +0800
committerruki <[email protected]>2017-08-03 18:06:40 +0800
commit2ab0a90c431f9cf80b5aa295e8d55d71c0ad7308 (patch)
treed27e747b2e434bb6005ad2fc0cc791983d90e395
parentbcb21e7b854ee16baf2c0b992ded6b4e7cefb76c (diff)
fix rebuild for deps
-rw-r--r--xmake/actions/build/main.lua15
-rw-r--r--xmake/actions/config/main.lua5
2 files changed, 19 insertions, 1 deletions
diff --git a/xmake/actions/build/main.lua b/xmake/actions/build/main.lua
index 1578b9e8d..3a9f4ca86 100644
--- a/xmake/actions/build/main.lua
+++ b/xmake/actions/build/main.lua
@@ -27,6 +27,7 @@ import("core.base.option")
import("core.base.task")
import("core.project.config")
import("core.project.project")
+import("core.project.cache", {nocache = true})
import("core.platform.platform")
import("builder")
@@ -39,6 +40,18 @@ function main()
-- config it first
task.run("config", {target = targetname})
+ -- enter cache scope
+ cache.enter("local.config")
+
+ -- rebuild?
+ local rebuild = option.get("rebuild") or cache.get("rebuild")
+
+ -- clear 'rebuild' mark in cache
+ if cache.get("rebuild") then
+ cache.set("rebuild", nil)
+ cache.flush()
+ end
+
-- enter project directory
local oldir = os.cd(project.directory())
@@ -46,7 +59,7 @@ function main()
try
{
function ()
- builder.build(targetname, option.get("rebuild"))
+ builder.build(targetname, rebuild)
end,
catch
diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua
index db530e730..9b84b58bc 100644
--- a/xmake/actions/config/main.lua
+++ b/xmake/actions/config/main.lua
@@ -62,6 +62,11 @@ function _need_check(changed)
changed = option.get("clean")
end
+ -- rebuild?
+ if changed then
+ cache.set("rebuild", true)
+ end
+
-- get the current mtimes
local mtimes = project.mtimes()