summaryrefslogtreecommitdiff
path: root/xmake/core/tool/compiler.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-04-30 21:56:24 +0800
committerruki <[email protected]>2023-04-30 21:56:24 +0800
commitd04dc34167154efd95f858a9ece38d04b9a2eddd (patch)
treeae29a7c54594f7722159d9915e7de20ef92cc046 /xmake/core/tool/compiler.lua
parent6adbd265b0312826a9915f68d38175ad5f62b8b2 (diff)
fix compiler and linker cache
Diffstat (limited to 'xmake/core/tool/compiler.lua')
-rw-r--r--xmake/core/tool/compiler.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/core/tool/compiler.lua b/xmake/core/tool/compiler.lua
index 8dc7bffd9..c11b2ba1d 100644
--- a/xmake/core/tool/compiler.lua
+++ b/xmake/core/tool/compiler.lua
@@ -121,7 +121,11 @@ function compiler.load(sourcekind, target)
end
-- init cache key
- local cachekey = sourcekind .. (program_or_errors or "") .. (config.get("arch") or os.arch())
+ -- @note we need plat/arch,
+ -- because it is possible for the compiler to do cross-compilation with the -target parameter
+ local plat = compiler_tool:plat() or config.plat() or os.host()
+ local arch = compiler_tool:arch() or config.arch() or os.arch()
+ local cachekey = sourcekind .. (program_or_errors or "") .. plat .. arch
-- get it directly from cache dirst
compiler._INSTANCES = compiler._INSTANCES or {}