From 886cc712bd80ac9a71a779b7eb518e72e05ed7ed Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 23 Sep 2024 22:43:36 +0800 Subject: improve program file for vsxmake #5642 --- xmake/plugins/project/vsxmake/getinfo.lua | 1 + xmake/scripts/vsxmake/vsproj/Xmake.Defaults.props | 3 +++ xmake/scripts/vsxmake/vsproj/Xmake.targets | 9 ++++++--- xmake/scripts/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj | 2 ++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua index 2981024ea..6feffa9dc 100644 --- a/xmake/plugins/project/vsxmake/getinfo.lua +++ b/xmake/plugins/project/vsxmake/getinfo.lua @@ -388,6 +388,7 @@ function main(outputdir, vsinfo) -- init solution directory vsinfo.solution_dir = path.absolute(path.join(outputdir, "vsxmake" .. vsinfo.vstudio_version)) vsinfo.programdir = _make_dirs(xmake.programdir()) + vsinfo.programfile = _make_dirs(xmake.programfile()) vsinfo.projectdir = project.directory() vsinfo.sln_projectfile = path.relative(project.rootfile(), vsinfo.solution_dir) local projectfile = path.filename(project.rootfile()) diff --git a/xmake/scripts/vsxmake/vsproj/Xmake.Defaults.props b/xmake/scripts/vsxmake/vsproj/Xmake.Defaults.props index 702647639..e10bfe203 100644 --- a/xmake/scripts/vsxmake/vsproj/Xmake.Defaults.props +++ b/xmake/scripts/vsxmake/vsproj/Xmake.Defaults.props @@ -3,16 +3,19 @@ <_XmakeProgramDir>$(XmakeProgramDir) + <_XmakeProgramFile>$(XmakeProgramFile) <_XmakeProjectDir>$(XmakeProjectDir) <_XmakeScriptDir>$(XmakeScriptDir) <_XmakeProgramDir Condition="!$([System.IO.Path]::IsPathRooted('$(_XmakeProgramDir)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(_XmakeProgramDir)')) + <_XmakeProgramFile Condition="!$([System.IO.Path]::IsPathRooted('$(_XmakeProgramFile)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(_XmakeProgramFile)')) <_XmakeProjectDir Condition="!$([System.IO.Path]::IsPathRooted('$(_XmakeProjectDir)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(_XmakeProjectDir)')) <_XmakeScriptDir Condition="!$([System.IO.Path]::IsPathRooted('$(_XmakeScriptDir)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(_XmakeScriptDir)')) $([System.IO.Path]::GetFullPath('$(_XmakeProgramDir)')) + $([System.IO.Path]::GetFullPath('$(_XmakeProgramFile)')) $([System.IO.Path]::GetFullPath('$(_XmakeProjectDir)')) $([System.IO.Path]::GetFullPath('$(_XmakeScriptDir)')) diff --git a/xmake/scripts/vsxmake/vsproj/Xmake.targets b/xmake/scripts/vsxmake/vsproj/Xmake.targets index 1dddc7728..bb5f64f52 100644 --- a/xmake/scripts/vsxmake/vsproj/Xmake.targets +++ b/xmake/scripts/vsxmake/vsproj/Xmake.targets @@ -30,6 +30,7 @@ $([System.IO.Path]::GetFullPath('$(XmakeProgramDir)/')) + $([System.IO.Path]::GetFullPath('$(XmakeProgramFile)/')) $([System.IO.Path]::GetFullPath('$(XmakeProjectDir)/')) $([System.IO.Path]::GetFullPath('$(XmakeScriptDir)/')) @@ -61,7 +62,7 @@ <_XmakeCommonFlags>$(_XmakeCommonFlags.Trim()) <_XmakeTarget>"$(XmakeTarget.Trim())" - <_XmakeExecutable>"$([System.IO.Path]::GetFullPath('$(XmakeProgramDirResolved)xmake.exe'))" + <_XmakeExecutable>"$([System.IO.Path]::GetFullPath('$(XmakeProgramFileResolved)'))" <_XmakeEnv> pushd $(XmakeProjectDirResolved) set XMAKE_CONFIGDIR=$(XmakeConfigDirResolved.TrimEnd('\').TrimEnd('/')) @@ -82,8 +83,8 @@ Text="File '$(VCTargetsPath)\BuildCustomizations\CUDA $(XmakeCudaVersion).targets' not found" /> - + $(XMAKE_PROGRAM_DIR) #programdir# + $(XMAKE_PROGRAM_FILE) + #programfile# #Import(XmakeConfig)# -- cgit v1.3.1