summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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!")