summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-08-26 23:25:03 +0800
committerruki <[email protected]>2019-08-26 14:30:20 +0800
commit2cf54c1bdc0c28ce571fcc5fe2dbb9380838dc85 (patch)
treeb7944b8dda14eb6b340110d5d29d1357a92f0e7e
parent025720a6a4907b25c244c46cf8f55fa1c22b0795 (diff)
improve autogen
-rw-r--r--xmake/actions/config/main.lua9
-rw-r--r--xmake/actions/config/scangen.lua3
2 files changed, 4 insertions, 8 deletions
diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua
index 1f185fe42..6e107dad9 100644
--- a/xmake/actions/config/main.lua
+++ b/xmake/actions/config/main.lua
@@ -146,10 +146,9 @@ function main()
_g.configured = true
-- scan project and generate it if xmake.lua not exists
+ local autogen = false
if not os.isfile(project.file()) then
-
- -- scan and generate it automatically
- local autogen = utils.confirm({default = false, description = "xmake.lua not found, try generating it"})
+ autogen = utils.confirm({default = false, description = "xmake.lua not found, try generating it"})
if autogen then
scangen()
else
@@ -196,7 +195,7 @@ force to build in current directory via run `xmake -P .`]], os.projectdir())
-- override configure from the options or cache
local options_changed = false
local options_history = {}
- if not option.get("clean") then
+ if not option.get("clean") and not autogen then
options_history = configcache:get("options_" .. targetname) or {}
options = options or options_history
end
@@ -243,7 +242,7 @@ force to build in current directory via run `xmake -P .`]], os.projectdir())
end
-- merge the checked configure
- local recheck = _need_check(options_changed or not configcache_loaded)
+ local recheck = _need_check(options_changed or not configcache_loaded or autogen)
if recheck then
-- clear detect cache
diff --git a/xmake/actions/config/scangen.lua b/xmake/actions/config/scangen.lua
index 0eb7adabf..c459491f2 100644
--- a/xmake/actions/config/scangen.lua
+++ b/xmake/actions/config/scangen.lua
@@ -63,9 +63,6 @@ function main()
sourcefiles = table.unique(sourcefiles)
sourcefiles_main = table.unique(sourcefiles_main)
- -- remove config directory first
- os.tryrm(config.directory())
-
-- project not found
if #sourcefiles == 0 and #sourcefiles_main == 0 then
raise("project not found!")