summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
authorruki <[email protected]>2025-06-03 23:49:24 +0800
committerruki <[email protected]>2025-06-03 23:49:24 +0800
commit618f7752fd27fd65fa6ceece235e4aaf32c499d1 (patch)
treef996045fec7d74b18e4d54af14da1f8e59ed51e5 /xmake/plugins
parentb51ce4ebec27a4ca3b10f29eb4bbfe3024c5f9fd (diff)
modify policy
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/project/vsxmake/getinfo.lua9
-rw-r--r--xmake/plugins/project/vsxmake/vsxmake.lua4
2 files changed, 7 insertions, 6 deletions
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua
index f8871af24..09c12ce0e 100644
--- a/xmake/plugins/project/vsxmake/getinfo.lua
+++ b/xmake/plugins/project/vsxmake/getinfo.lua
@@ -393,10 +393,11 @@ function main(outputdir, vsinfo)
local oldir = os.cd(project.directory())
-- init solution directory
- if project.policy("generator.vsxmake.multiversion") then
- vsinfo.solution_dir = path.absolute(path.join(outputdir, "vsxmake" .. vsinfo.vstudio_version))
- else
+ vsinfo.vcxproj_rootdir = path.absolute(path.join(outputdir, "vsxmake" .. vsinfo.vstudio_version))
+ if project.policy("generator.vsxmake.root_sln") then
vsinfo.solution_dir = path.absolute(outputdir)
+ else
+ vsinfo.solution_dir = vsinfo.vcxproj_rootdir
end
vsinfo.programdir = _make_dirs(xmake.programdir())
vsinfo.programfile = xmake.programfile()
@@ -495,7 +496,7 @@ function main(outputdir, vsinfo)
-- init target info
_target.target = targetname
- _target.vcxprojdir = path.join(vsinfo.solution_dir, targetname)
+ _target.vcxprojdir = path.join(vsinfo.vcxproj_rootdir, targetname)
_target.target_id = hash.uuid4(targetname)
_target.kind = target:kind()
_target.absscriptdir = target:scriptdir()
diff --git a/xmake/plugins/project/vsxmake/vsxmake.lua b/xmake/plugins/project/vsxmake/vsxmake.lua
index 2b3ded5d6..d5cd5e078 100644
--- a/xmake/plugins/project/vsxmake/vsxmake.lua
+++ b/xmake/plugins/project/vsxmake/vsxmake.lua
@@ -235,8 +235,8 @@ function make(version)
_writefileifneeded(sln, render(template_sln, "#([A-Za-z0-9_,%.%*%(%)]+)#", "@([^@]+)@", paramsprovidersln))
-- add solution custom file
- _trycp(template_props, info.solution_dir)
- _trycp(template_targets, info.solution_dir)
+ _trycp(template_props, info.vcxproj_rootdir)
+ _trycp(template_targets, info.vcxproj_rootdir)
for _, target in ipairs(info.targets) do
local paramsprovidertarget = _buildparams(info, target, "<!-- nil -->")