diff options
| -rw-r--r-- | xmake/core/project/policy.lua | 4 | ||||
| -rw-r--r-- | xmake/plugins/project/vsxmake/getinfo.lua | 6 |
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() |
