summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2021-05-21 23:38:00 +0800
committerruki <[email protected]>2021-05-21 23:38:00 +0800
commit81b6bcf17837db9771ba3781dd63e90ce6af2d65 (patch)
tree7013a6e2b90a27cf6d321af027025c1b7da30e1e /xmake/modules
parentab71fcb7bfaf85340c92425a9e167e172b25fa76 (diff)
set binary as default target kind
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/core/tools/link.lua15
-rw-r--r--xmake/modules/private/utils/complete_helper.lua2
2 files changed, 10 insertions, 7 deletions
diff --git a/xmake/modules/core/tools/link.lua b/xmake/modules/core/tools/link.lua
index 9ee2dd7f2..e7e1596f5 100644
--- a/xmake/modules/core/tools/link.lua
+++ b/xmake/modules/core/tools/link.lua
@@ -77,12 +77,15 @@ function nf_symbol(self, level, target)
-- debug? generate *.pdb file
local flags = nil
- local targetkind = target:get("kind")
- if level == "debug" and (targetkind == "binary" or targetkind == "shared") then
- if target and target.symbolfile then
- flags = {"-debug", "-pdb:" .. target:symbolfile()}
- else
- flags = "-debug"
+ if target then
+ if target:type() == "target" then
+ if level == "debug" and (target:is_binary() or target:is_shared()) then
+ flags = {"-debug", "-pdb:" .. target:symbolfile()}
+ end
+ else -- for option
+ if level == "debug" then
+ flags = "-debug"
+ end
end
end
return flags
diff --git a/xmake/modules/private/utils/complete_helper.lua b/xmake/modules/private/utils/complete_helper.lua
index 89b542d30..386f50194 100644
--- a/xmake/modules/private/utils/complete_helper.lua
+++ b/xmake/modules/private/utils/complete_helper.lua
@@ -42,7 +42,7 @@ function runable_targets()
local targets = project.targets()
local runable = {}
for k, v in pairs(targets) do
- if v:script("run") or v:get("kind") == "binary" then
+ if v:script("run") or v:is_binary() then
table.insert(runable, k)
end
end