summaryrefslogtreecommitdiff
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
parentab71fcb7bfaf85340c92425a9e167e172b25fa76 (diff)
set binary as default target kind
-rw-r--r--xmake/core/project/target.lua2
-rw-r--r--xmake/modules/core/tools/link.lua15
-rw-r--r--xmake/modules/private/utils/complete_helper.lua2
-rw-r--r--xmake/plugins/project/vsxmake/getinfo.lua2
4 files changed, 12 insertions, 9 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 67e7e31f3..38d207656 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -456,7 +456,7 @@ end
-- get the target kind
function _instance:kind()
- return self:get("kind") or "phony"
+ return self:get("kind") or "binary"
end
-- get the target kind (deprecated)
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
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua
index 0c96a70ad..407e4cbe4 100644
--- a/xmake/plugins/project/vsxmake/getinfo.lua
+++ b/xmake/plugins/project/vsxmake/getinfo.lua
@@ -134,7 +134,7 @@ function _make_targetinfo(mode, arch, target)
-- use target:get("xxx") rather than target:xxx()
-- save target kind
- targetinfo.kind = target:get("kind")
+ targetinfo.kind = target:kind()
-- is default?
targetinfo.default = tostring(target:is_default())