summaryrefslogtreecommitdiff
path: root/xmake/modules/lib/detect
diff options
context:
space:
mode:
authorruki <[email protected]>2018-12-20 23:46:03 +0800
committerruki <[email protected]>2018-12-20 16:36:22 +0800
commit38315771588ae29bacc20cae6a16fa0d4d8a2be5 (patch)
tree063f662f1e8c22b39864e3b0d3c94355c3b633c8 /xmake/modules/lib/detect
parenta9f3eac5faf29e1a60b68ec2ac7ec791ef7549ee (diff)
improve compiler and linker
Diffstat (limited to 'xmake/modules/lib/detect')
-rw-r--r--xmake/modules/lib/detect/has_flags.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/xmake/modules/lib/detect/has_flags.lua b/xmake/modules/lib/detect/has_flags.lua
index 66bdcfece..4f3d42eab 100644
--- a/xmake/modules/lib/detect/has_flags.lua
+++ b/xmake/modules/lib/detect/has_flags.lua
@@ -76,7 +76,10 @@ function main(name, flags, opt)
opt.program = tool.program
opt.programver = tool.version
- -- get tool arch
+ -- get tool platform
+ local plat = config.get("plat") or os.host()
+
+ -- get tool architecture
--
-- some tools select arch by path environment, not be flags, .e.g cl.exe of msvc)
-- so, it will affect the cache result
@@ -84,7 +87,7 @@ function main(name, flags, opt)
local arch = config.get("arch") or os.arch()
-- init cache key
- local key = tool.program .. "_" .. (tool.version or "") .. "_" .. (opt.toolkind or "") .. "_" .. table.concat(flags, " ") .. "_" .. arch
+ local key = plat .. "_" .. arch .. "_" .. tool.program .. "_" .. (tool.version or "") .. "_" .. (opt.toolkind or "") .. "_" .. table.concat(flags, " ")
-- @note avoid detect the same program in the same time if running in the coroutine (.e.g ccache)
local coroutine_running = coroutine.running()