summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/scanner.lua
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2025-04-24 16:35:23 +0200
committerArthur LAURENT <[email protected]>2025-04-24 16:35:23 +0200
commit58854bf7b3018a7d52dbaea096cdd4d2307dc27d (patch)
tree66dcda01a8a8648e82877a1b1da2a32530e81841 /xmake/rules/c++/modules/scanner.lua
parent175b91c0dbd964499e1049db5c70991deb87123c (diff)
(C++ modules support) factorize implementation getter
Diffstat (limited to 'xmake/rules/c++/modules/scanner.lua')
-rw-r--r--xmake/rules/c++/modules/scanner.lua17
1 files changed, 1 insertions, 16 deletions
diff --git a/xmake/rules/c++/modules/scanner.lua b/xmake/rules/c++/modules/scanner.lua
index 18f90cfca..5d5054460 100644
--- a/xmake/rules/c++/modules/scanner.lua
+++ b/xmake/rules/c++/modules/scanner.lua
@@ -28,22 +28,7 @@ import("support")
import("stlheaders")
function _scanner(target)
- local cachekey = tostring(target)
- local scanner = support.memcache():get2("scanner", cachekey)
- if scanner == nil then
- if target:has_tool("cxx", "clang", "clangxx", "clang_cl") then
- scanner = import("clang.scanner", {anonymous = true})
- elseif target:has_tool("cxx", "gcc", "gxx") then
- scanner = import("gcc.scanner", {anonymous = true})
- elseif target:has_tool("cxx", "cl") then
- scanner = import("msvc.scanner", {anonymous = true})
- else
- local _, toolname = target:tool("cxx")
- raise("compiler(%s): does not support c++ module!", toolname)
- end
- support.memcache():set2("scanner", cachekey, scanner)
- end
- return scanner
+ return support.import_implementation_of(target, "scanner")
end
function _parse_meta_info(target, metafile)