From 3ceb269a042686b96d6e2d04fecf2606520ceba3 Mon Sep 17 00:00:00 2001 From: ShifftC Date: Fri, 1 Dec 2023 18:31:24 +0100 Subject: [PATCH 1/3] Fix visual studio startup project Binary targets would always override default targets. --- xmake/plugins/project/vstudio/impl/vs201x_solution.lua | 2 +- xmake/plugins/project/vsxmake/getinfo.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xmake/plugins/project/vstudio/impl/vs201x_solution.lua b/xmake/plugins/project/vstudio/impl/vs201x_solution.lua index ea2d8e1faa4..bd86cbc7c88 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x_solution.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x_solution.lua @@ -43,7 +43,7 @@ function _make_projects(slnfile, vsinfo) table.insert(targets, 1, target) elseif target:is_binary() then local first_target = targets[1] - if not first_target or first_target:is_default() then + if not first_target or not first_target:is_default() then table.insert(targets, 1, target) else table.insert(targets, target) diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua index 7ec79ad6ec5..4c82dbe9394 100644 --- a/xmake/plugins/project/vsxmake/getinfo.lua +++ b/xmake/plugins/project/vsxmake/getinfo.lua @@ -580,7 +580,7 @@ function main(outputdir, vsinfo) table.insert(targetnames, 1, targetname) elseif target:is_binary() then local first_target = targetnames[1] and project.target(targetnames[1]) - if not first_target or first_target:is_default() then + if not first_target or not first_target:is_default() then table.insert(targetnames, 1, targetname) else table.insert(targetnames, targetname) From b0eaababcc57fc56104f507cdbced3e69dcaed1b Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 2 Dec 2023 08:00:13 +0800 Subject: [PATCH 2/3] Update vs201x_solution.lua --- xmake/plugins/project/vstudio/impl/vs201x_solution.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/plugins/project/vstudio/impl/vs201x_solution.lua b/xmake/plugins/project/vstudio/impl/vs201x_solution.lua index bd86cbc7c88..82ede489a75 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x_solution.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x_solution.lua @@ -43,7 +43,7 @@ function _make_projects(slnfile, vsinfo) table.insert(targets, 1, target) elseif target:is_binary() then local first_target = targets[1] - if not first_target or not first_target:is_default() then + if not first_target or first_target:get("default") ~= true then table.insert(targets, 1, target) else table.insert(targets, target) From 37a707e12d226e3a5de0cd2afb7951bb5b9676ef Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 2 Dec 2023 08:00:40 +0800 Subject: [PATCH 3/3] Update getinfo.lua --- xmake/plugins/project/vsxmake/getinfo.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua index 4c82dbe9394..e992c1bd488 100644 --- a/xmake/plugins/project/vsxmake/getinfo.lua +++ b/xmake/plugins/project/vsxmake/getinfo.lua @@ -580,7 +580,7 @@ function main(outputdir, vsinfo) table.insert(targetnames, 1, targetname) elseif target:is_binary() then local first_target = targetnames[1] and project.target(targetnames[1]) - if not first_target or not first_target:is_default() then + if not first_target or first_target:get("default") ~= true then table.insert(targetnames, 1, targetname) else table.insert(targetnames, targetname)