summaryrefslogtreecommitdiff
path: root/xmake/core
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2025-11-02 18:08:17 +0100
committerArthur LAURENT <[email protected]>2025-11-02 18:08:17 +0100
commitffd3dd3885359c969d36d3ea963e011c50dc854d (patch)
tree353cb2b3b29a5e7b9d345928733f75785116617b /xmake/core
parent6bb310b029f7adb13709d73655b635649b7c5814 (diff)
fix(target) cache compiler by sourcekind instead of global cache for target
Diffstat (limited to 'xmake/core')
-rw-r--r--xmake/core/project/target.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 3f9e7b813..6547a4a6c 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -1065,17 +1065,17 @@ end
-- get the target compiler
function _instance:compiler(sourcekind)
- local compilerinst = self:_memcache():get("compiler")
+ if not sourcekind then
+ os.raise("please pass sourcekind to the first argument of target:compiler(), e.g. cc, cxx, as")
+ end
+ local compilerinst = self:_memcache():get("compiler_" .. sourcekind)
if not compilerinst then
- if not sourcekind then
- os.raise("please pass sourcekind to the first argument of target:compiler(), e.g. cc, cxx, as")
- end
local instance, errors = compiler.load(sourcekind, self)
if not instance then
os.raise(errors)
end
compilerinst = instance
- self:_memcache():set("compiler", compilerinst)
+ self:_memcache():set("compiler_" .. sourcekind, compilerinst)
end
return compilerinst
end