summaryrefslogtreecommitdiff
path: root/xmake/core/package/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-12-22 22:17:56 +0800
committerGitHub <[email protected]>2025-12-22 22:17:56 +0800
commit70961e6e12d35fc76f1819a7633bc4e5dd32b7a7 (patch)
tree8b26a3bc1fb447a9dabbd96d1884dbc322d6a9e9 /xmake/core/package/package.lua
parentec6b795ae184f9c7e1d14f0b6de99afeff7bb89b (diff)
parentd72d0378c40faa23a3063bacfc47e08b919c4031 (diff)
Merge pull request #7155 from star-hengxing/windows-clang-asan
Refactor windows asan
Diffstat (limited to 'xmake/core/package/package.lua')
-rw-r--r--xmake/core/package/package.lua17
1 files changed, 2 insertions, 15 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 780bf6608..ecffbc88f 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -2457,21 +2457,8 @@ end
-- generate sanitizer configs
function _instance:_generate_sanitizer_configs(checkmode, sourcekind)
-
- -- add cflags
- local configs = {}
- if sourcekind and self:has_tool(sourcekind, "cl", "clang", "clangxx", "gcc", "gxx") then
- local cflag = sourcekind == "cxx" and "cxxflags" or "cflags"
- configs[cflag] = "-fsanitize=" .. checkmode
- end
-
- -- add ldflags and shflags
- -- msvc does not have an fsanitize linker flag, so the 'link' tool is excluded
- if self:has_tool("ld", "clang", "clangxx", "gcc", "gxx") then
- configs.ldflags = "-fsanitize=" .. checkmode
- configs.shflags = "-fsanitize=" .. checkmode
- end
- return configs
+ local toolchain_utils = sandbox_module.import("private.utils.toolchain", {anonymous = true})
+ return toolchain_utils.get_sanitizer_flags(self, {checkmode = checkmode, sourcekind = sourcekind})
end
-- generate building configs for has_xxx/check_xxx