summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
authorruki <[email protected]>2021-03-05 22:42:07 +0800
committerruki <[email protected]>2021-03-05 22:42:07 +0800
commit1e293d3a5f31afed5e4f78670d66b5b18ccc2608 (patch)
tree72ca0441699eb35457f59a302a0d35340fe5de16 /xmake/plugins
parent97e94809e0ffb871b2e8a7554ad3eb54a034c525 (diff)
add is_default
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/project/clang/compile_flags.lua4
-rw-r--r--xmake/plugins/project/make/makefile.lua3
-rw-r--r--xmake/plugins/project/ninja/build_ninja.lua3
-rw-r--r--xmake/plugins/project/vsxmake/getinfo.lua2
4 files changed, 4 insertions, 8 deletions
diff --git a/xmake/plugins/project/clang/compile_flags.lua b/xmake/plugins/project/clang/compile_flags.lua
index f85ed631b..3f521b916 100644
--- a/xmake/plugins/project/clang/compile_flags.lua
+++ b/xmake/plugins/project/clang/compile_flags.lua
@@ -74,11 +74,9 @@ end
-- make all
function _make_all()
- -- make flags
_g.firstline = true
for _, target in pairs(project.targets()) do
- local isdefault = target:get("default")
- if not target:is_phony() and (isdefault == nil or isdefault == true) then
+ if not target:is_phony() and target:is_default() then
_make_target(target)
end
end
diff --git a/xmake/plugins/project/make/makefile.lua b/xmake/plugins/project/make/makefile.lua
index 6a8d18650..75afafa92 100644
--- a/xmake/plugins/project/make/makefile.lua
+++ b/xmake/plugins/project/make/makefile.lua
@@ -392,8 +392,7 @@ function _make_all(makefile)
-- make all
local default = ""
for targetname, target in pairs(project.targets()) do
- local isdefault = target:get("default")
- if isdefault == nil or isdefault == true then
+ if target:is_default() then
default = default .. " " .. targetname
end
end
diff --git a/xmake/plugins/project/ninja/build_ninja.lua b/xmake/plugins/project/ninja/build_ninja.lua
index 041639a40..72bb44a1d 100644
--- a/xmake/plugins/project/ninja/build_ninja.lua
+++ b/xmake/plugins/project/ninja/build_ninja.lua
@@ -306,8 +306,7 @@ function _add_build_for_targets(ninjafile)
-- build default
local default = ""
for targetname, target in pairs(project.targets()) do
- local isdefault = target:get("default")
- if isdefault == nil or isdefault == true then
+ if target:is_default() then
default = default .. " " .. targetname
end
end
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua
index 8d36cdbe7..d1d9895bb 100644
--- a/xmake/plugins/project/vsxmake/getinfo.lua
+++ b/xmake/plugins/project/vsxmake/getinfo.lua
@@ -446,7 +446,7 @@ function main(outputdir, vsinfo)
if not target:is_phony() then
if target:get("default") == true then
table.insert(targetnames, 1, targetname)
- elseif target:kind() == "binary" then
+ elseif target:is_binary() then
local first_target = targetnames[1] and project.target(targetnames[1])
if not first_target or first_target:get("default") ~= true then
table.insert(targetnames, 1, targetname)