summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-06-03 00:41:00 +0800
committerruki <[email protected]>2025-06-03 00:41:00 +0800
commitb975efbeb8091ee9e6ff10bd3a55a58cde80ff7c (patch)
treeecda13a070a5038d69943a05f39343668173bc9b
parent1df3b5ed4d4bec078a44ade91a8603ba375d0577 (diff)
add multiversion vsxmake policy #6519
-rw-r--r--xmake/core/project/policy.lua4
-rw-r--r--xmake/plugins/project/vsxmake/getinfo.lua6
2 files changed, 8 insertions, 2 deletions
diff --git a/xmake/core/project/policy.lua b/xmake/core/project/policy.lua
index 0c79be649..d6f0a063d 100644
--- a/xmake/core/project/policy.lua
+++ b/xmake/core/project/policy.lua
@@ -178,7 +178,9 @@ function policy.policies()
-- private: it will disable fetch remote package repositories
["network.mode"] = {description = "Set the network mode", type = "string"},
-- Set the compatibility version, e.g. 2.0, 3.0
- ["compatibility.version"] = {description = "Set the compatibility version", type = "string", default = "3.0", values = {"2.0", "3.0"}}
+ ["compatibility.version"] = {description = "Set the compatibility version", type = "string", default = "3.0", values = {"2.0", "3.0"},
+ -- Enable or disable multiverison solution output
+ ["generator.vsxmake.multiversion"] = {description = "Enable or disable multiverison solution output", default = true, type = "boolean"}}
}
policy._POLICIES = policies
end
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua
index ae69fbb58..f8871af24 100644
--- a/xmake/plugins/project/vsxmake/getinfo.lua
+++ b/xmake/plugins/project/vsxmake/getinfo.lua
@@ -393,7 +393,11 @@ function main(outputdir, vsinfo)
local oldir = os.cd(project.directory())
-- init solution directory
- vsinfo.solution_dir = path.absolute(path.join(outputdir, "vsxmake" .. vsinfo.vstudio_version))
+ if project.policy("generator.vsxmake.multiversion") then
+ vsinfo.solution_dir = path.absolute(path.join(outputdir, "vsxmake" .. vsinfo.vstudio_version))
+ else
+ vsinfo.solution_dir = path.absolute(outputdir)
+ end
vsinfo.programdir = _make_dirs(xmake.programdir())
vsinfo.programfile = xmake.programfile()
vsinfo.projectdir = project.directory()