Skip to content

Commit a80d2d3

Browse files
committed
improve detectcache save
1 parent 589d431 commit a80d2d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+11
-49
lines changed

tests/apis/custom_toolchain/xmake/modules/core/tools/cl6x/has_flags.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ function _check_from_arglist(flags, opt, islinker)
6060
end
6161
end
6262
detectcache:set2(key, flagskey, allflags)
63-
detectcache:save()
6463
end
6564
local flag = flags[1]
6665
return allflags[flag]

xmake/actions/build/main.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import("core.base.option")
2323
import("core.base.global")
2424
import("core.base.task")
2525
import("core.tool.toolchain")
26+
import("core.cache.detectcache")
2627
import("core.project.rule")
2728
import("core.project.config")
2829
import("core.project.project")
@@ -130,6 +131,9 @@ function build_targets(targetnames, opt)
130131
-- save toolchain configs
131132
toolchain.save()
132133

134+
-- save detect cache
135+
detectcache:save()
136+
133137
-- dump cache stats
134138
if option.get("diagnosis") then
135139
build_cache.dump_stats()
@@ -148,6 +152,9 @@ function build_targets(targetnames, opt)
148152
-- save toolchain configs
149153
toolchain.save()
150154

155+
-- save detect cache
156+
detectcache:save()
157+
151158
-- raise
152159
if errors then
153160
raise(errors)

xmake/actions/config/main.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import("core.project.project")
2828
import("core.platform.platform")
2929
import("private.detect.find_platform")
3030
import("core.cache.localcache")
31+
import("core.cache.detectcache")
3132
import("scangen")
3233
import("menuconf", {alias = "menuconf_show"})
3334
import("configfiles", {alias = "generate_configfiles"})
@@ -448,6 +449,9 @@ force to build in current directory via run `xmake -P .`]], os.projectdir())
448449
-- save toolchain cache
449450
toolchain.save()
450451

452+
-- save detect cache
453+
detectcache:save()
454+
451455
-- unlock the whole project
452456
project.unlock()
453457
end

xmake/core/sandbox/modules/import/lib/detect/find_program.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ function sandbox_lib_detect_find_program.main(name, opt)
338338

339339
-- cache result
340340
detectcache:set2(cachekey, name, result and result or false)
341-
detectcache:save()
342341

343342
-- trace
344343
if option.get("verbose") or opt.verbose then

xmake/core/sandbox/modules/import/lib/detect/find_programver.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ function sandbox_lib_detect_find_programver.main(program, opt)
109109

110110
-- save result
111111
detectcache:set2(cachekey, program, result and result or false)
112-
detectcache:save()
113112
scheduler.co_unlock(lockname)
114113
return result
115114
end

xmake/modules/core/tools/ar/has_flags.lua

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,7 @@ function _check_from_arglist(flags, opt)
6363

6464
-- save cache
6565
detectcache:set2(key, flagskey, allflags)
66-
detectcache:save()
6766
end
68-
69-
-- ok?
7067
return allflags[flags[1]]
7168
end
7269

xmake/modules/core/tools/armasm_msvc/has_flags.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ function _check_from_arglist(flags, opt)
5050

5151
-- save cache
5252
detectcache:set2(key, flagskey, allflags)
53-
detectcache:save()
5453
end
5554
return allflags[flags[1]:gsub("/", "-")]
5655
end

xmake/modules/core/tools/armclang/has_flags.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ function _check_from_arglist(flags, opt, islinker)
6767
end
6868
end
6969
detectcache:set2(key, flagskey, allflags)
70-
detectcache:save()
7170
end
7271
local flag = flags[1]
7372
if islinker and flag then

xmake/modules/core/tools/cl/parse_include.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ function probe_include_note_from_cl()
6060
os.tryrm(projectdir)
6161
end
6262
detectcache:set(key, note)
63-
detectcache:save()
6463
end
6564
return note
6665
end

xmake/modules/core/tools/cl6x/has_flags.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ function _check_from_arglist(flags, opt, islinker)
6060
end
6161
end
6262
detectcache:set2(key, flagskey, allflags)
63-
detectcache:save()
6463
end
6564
local flag = flags[1]
6665
return allflags[flag]

0 commit comments

Comments
 (0)