summaryrefslogtreecommitdiff
path: root/xmake/core/tool/compiler.lua
diff options
context:
space:
mode:
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 {}