summaryrefslogtreecommitdiff
path: root/xmake/core/package/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-09-21 22:40:21 +0800
committerruki <[email protected]>2023-09-21 22:40:21 +0800
commit8afc0e7ed5d14918fa4fafd450b23263f62ea147 (patch)
tree42ae5604bb4582d83028ba811a90ff623e9856a5 /xmake/core/package/package.lua
parent3d9cf6af8a3fae36dbb5e8fe055a54000ddcadfb (diff)
enable asan for package
Diffstat (limited to 'xmake/core/package/package.lua')
-rw-r--r--xmake/core/package/package.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 10d32a0ca..4df947d66 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -2112,11 +2112,11 @@ function _instance:_generate_lto_configs(sourcekind)
end
-- generate sanitizer configs
-function _instance:_generate_sanitizer_configs(sourcekind, checkmode)
+function _instance:_generate_sanitizer_configs(checkmode, sourcekind)
-- add cflags
local configs = {}
- if self:has_tool(sourcekind, "cl", "clang", "clangxx", "gcc", "gxx") then
+ 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
@@ -2165,7 +2165,7 @@ function _instance:_generate_build_configs(configs, opt)
end
end
if self:config("asan") then
- local configs_asan = self:_generate_sanitizer_configs(opt.sourcekind or "cxx", "address")
+ local configs_asan = self:_generate_sanitizer_configs("address", opt.sourcekind or "cxx")
if configs_asan then
for k, v in pairs(configs_asan) do
configs[k] = table.wrap(configs[k] or {})