summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-07-20 18:33:31 +0800
committerOpportunityLiu <[email protected]>2019-07-20 18:33:31 +0800
commit81acc02e79365957d37e98fbe70887edccfebba6 (patch)
treeaf1f7c6ab5deec15471874ae8228d8b8e3f8e82b
parent1c516661533fc17e31f6d1b90689f752e7ef83f2 (diff)
add property page
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/Xmake.props33
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/Xmake.targets105
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/Xmake.xml76
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/#target#.vcxproj.user10
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.props11
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.c(filec)2
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cu(filecu)2
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cxx(filecxx)2
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.obj(fileobj)2
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.rc(filerc)2
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/Include(inc)2
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.c(filec)2
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cu(filecu)2
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cxx(filecxx)2
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.obj(fileobj)2
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.rc(filerc)2
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/Include(inc)2
-rw-r--r--xmake/plugins/project/vsxmake/vsxmake.lua3
18 files changed, 184 insertions, 78 deletions
diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.props b/xmake/plugins/project/vsxmake/vsproj/Xmake.props
index e954a435b..55fd2bdc5 100644
--- a/xmake/plugins/project/vsxmake/vsproj/Xmake.props
+++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.props
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
<PropertyGroup Label="XmakePropsInit">
<!-- initialize this first to allow `Condition="'$(XmakeMode)|$(XmakeArch)' == 'release|x86'"` in custom props file -->
<XmakeMode Condition="'$(XmakeMode)' == ''">$(Configuration)</XmakeMode>
@@ -38,31 +39,11 @@
<XmakeRunDir Condition="'$(XmakeRunDir)' == ''">$(XmakeTargetDir)</XmakeRunDir>
</PropertyGroup>
- <PropertyGroup Label="XmakePathsResolve">
- <!-- resolve if they are relative paths -->
- <XmakeProjectDir Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeProjectDir)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeProjectDir)'))</XmakeProjectDir>
- <XmakeScriptDir Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeScriptDir)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeScriptDir)'))</XmakeScriptDir>
- <XmakeBuilDir Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeBuilDir)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeBuilDir)'))</XmakeBuilDir>
- <XmakeTargetDir Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeTargetDir)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeTargetDir)'))</XmakeTargetDir>
- <XmakeConfigDir Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeConfigDir)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeConfigDir)'))</XmakeConfigDir>
- <XmakeConfigFileDir Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeConfigFileDir)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeConfigFileDir)'))</XmakeConfigFileDir>
- <XmakeRunDir Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeRunDir)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeRunDir)'))</XmakeRunDir>
-
- <!-- normalize paths -->
- <XmakeProgramDir>$([System.IO.Path]::GetFullPath('$(XmakeProgramDir)/'))</XmakeProgramDir>
- <XmakeProjectDir>$([System.IO.Path]::GetFullPath('$(XmakeProjectDir)/'))</XmakeProjectDir>
- <XmakeScriptDir>$([System.IO.Path]::GetFullPath('$(XmakeScriptDir)/'))</XmakeScriptDir>
- <XmakeBuilDir>$([System.IO.Path]::GetFullPath('$(XmakeBuilDir)/'))</XmakeBuilDir>
- <XmakeTargetDir>$([System.IO.Path]::GetFullPath('$(XmakeTargetDir)/'))</XmakeTargetDir>
- <XmakeConfigDir>$([System.IO.Path]::GetFullPath('$(XmakeConfigDir)/'))</XmakeConfigDir>
- <XmakeConfigFileDir>$([System.IO.Path]::GetFullPath('$(XmakeConfigFileDir)/'))</XmakeConfigFileDir>
- <XmakeRunDir>$([System.IO.Path]::GetFullPath('$(XmakeRunDir)/'))</XmakeRunDir>
- </PropertyGroup>
-
<PropertyGroup Label="XmakeFlagsFallback">
<XmakeWarning Condition="'$(XmakeWarning)' == ''">true</XmakeWarning>
<XmakeVerbose Condition="'$(XmakeVerbose)' == ''">false</XmakeVerbose>
<XmakeDiagnosis Condition="'$(XmakeDiagnosis)' == ''">false</XmakeDiagnosis>
+ <XmakeRebuildFile Condition="'$(XmakeRebuildFile)' == ''">false</XmakeRebuildFile>
</PropertyGroup>
<PropertyGroup Condition="'$(WindowsTargetPlatformVersion)' == ''">
@@ -116,6 +97,12 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ItemGroup>
+ <PropertyPageSchema Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml">
+ <Context>Project</Context>
+ </PropertyPageSchema>
+ </ItemGroup>
+
<ImportGroup Label="ExtensionSettings">
<Import Condition="'$(XmakeCudaVersion)' != '' And Exists('$(VCTargetsPath)\BuildCustomizations\CUDA $(XmakeCudaVersion).props')"
Project="$(VCTargetsPath)\BuildCustomizations\CUDA $(XmakeCudaVersion).props" />
@@ -135,8 +122,8 @@
<PropertyGroup Label="Path">
<IncludePath>$(XmakeIncludeDir);$(IncludePath)</IncludePath>
<LibraryPath>$(XmakeLinkDir);$(LibraryPath)</LibraryPath>
- <OutDir>$(XmakeTargetDir)</OutDir>
- <IntDir>$(XmakeBuilDir).vs\$(TargetName)\$(XmakeArch)\$(XmakeMode)\</IntDir>
+ <OutDir>$(XmakeTargetDir)\</OutDir>
+ <IntDir>$(XmakeBuilDir)\.vs\$(TargetName)\$(XmakeArch)\$(XmakeMode)\</IntDir>
</PropertyGroup>
<!-- Common files -->
diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
index 55a698927..8aa2db642 100644
--- a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
+++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
@@ -7,36 +7,80 @@
Project="$(VCTargetsPath)\BuildCustomizations\CUDA $(XmakeCudaVersion).targets" />
</ImportGroup>
+ <PropertyGroup Label="XmakePathsResolve">
+ <XmakeProgramDirResolved>$(XmakeProgramDir)</XmakeProgramDirResolved>
+ <XmakeProjectDirResolved>$(XmakeProjectDir)</XmakeProjectDirResolved>
+ <XmakeScriptDirResolved>$(XmakeScriptDir)</XmakeScriptDirResolved>
+ <XmakeBuilDirResolved>$(XmakeBuilDir)</XmakeBuilDirResolved>
+ <XmakeTargetDirResolved>$(XmakeTargetDir)</XmakeTargetDirResolved>
+ <XmakeConfigDirResolved>$(XmakeConfigDir)</XmakeConfigDirResolved>
+ <XmakeConfigFileDirResolved>$(XmakeConfigFileDir)</XmakeConfigFileDirResolved>
+ <XmakeRunDirResolved>$(XmakeRunDir)</XmakeRunDirResolved>
+
+ <!-- resolve if they are relative paths -->
+ <XmakeProjectDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeProjectDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeProjectDirResolved)'))</XmakeProjectDirResolved>
+ <XmakeScriptDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeScriptDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeScriptDirResolved)'))</XmakeScriptDirResolved>
+ <XmakeBuilDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeBuilDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeBuilDirResolved)'))</XmakeBuilDirResolved>
+ <XmakeTargetDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeTargetDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeTargetDirResolved)'))</XmakeTargetDirResolved>
+ <XmakeConfigDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeConfigDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeConfigDirResolved)'))</XmakeConfigDirResolved>
+ <XmakeConfigFileDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeConfigFileDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeConfigFileDirResolved)'))</XmakeConfigFileDirResolved>
+ <XmakeRunDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeRunDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeRunDirResolved)'))</XmakeRunDirResolved>
+
+ <!-- normalize paths -->
+ <XmakeProgramDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeProgramDirResolved)/'))</XmakeProgramDirResolved>
+ <XmakeProjectDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeProjectDirResolved)/'))</XmakeProjectDirResolved>
+ <XmakeScriptDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeScriptDirResolved)/'))</XmakeScriptDirResolved>
+ <XmakeBuilDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeBuilDirResolved)/'))</XmakeBuilDirResolved>
+ <XmakeTargetDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeTargetDirResolved)/'))</XmakeTargetDirResolved>
+ <XmakeConfigDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeConfigDirResolved)/'))</XmakeConfigDirResolved>
+ <XmakeConfigFileDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeConfigFileDirResolved)/'))</XmakeConfigFileDirResolved>
+ <XmakeRunDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeRunDirResolved)/'))</XmakeRunDirResolved>
+ </PropertyGroup>
+
+ <PropertyGroup Label="Debugger">
+ <LocalDebuggerWorkingDirectory>$(XmakeRunDirResolved)</LocalDebuggerWorkingDirectory>
+ <LocalDebuggerEnvironment>$(XmakeRunEnvs)
+$(LocalDebuggerEnvironment)</LocalDebuggerEnvironment>
+ <LocalDebuggerMergeEnvironment>true</LocalDebuggerMergeEnvironment>
+ <RemoteDebuggerWorkingDirectory>$(XmakeRunDirResolved)</RemoteDebuggerWorkingDirectory>
+ <DebuggerFlavor>WindowsRemoteDebugger</DebuggerFlavor>
+ <RemoteDebuggerEnvironment>$(XmakeRunEnvs)
+$(RemoteDebuggerEnvironment)</RemoteDebuggerEnvironment>
+ </PropertyGroup>
+
<PropertyGroup Label="XmakeInternal">
<_XmakeProjectFlag Condition="'$(XmakeProjectFile)' != ''">-F "$(XmakeProjectFile)"</_XmakeProjectFlag>
<_XmakeProjectFlag Condition="'$(XmakeProjectFile)' == ''">-P .</_XmakeProjectFlag>
<_XmakeCommonFlags>$(XmakeCommonFlags.Trim())</_XmakeCommonFlags>
- <_XmakeCommonFlags Condition="$(XmakeVerbose)">-v $(_XmakeCommonFlags)</_XmakeCommonFlags>
- <_XmakeCommonFlags Condition="$(XmakeDiagnosis)">-D $(_XmakeCommonFlags)</_XmakeCommonFlags>
- <_XmakeCommonFlags>$(XmakeCommonFlags.Trim())</_XmakeCommonFlags>
- <_XmakeCommonFlags>$(_XmakeCommonFlags) $(_XmakeProjectFlag)</_XmakeCommonFlags>
+ <_XmakeCommonFlags Condition="$(XmakeVerbose)">-v $(_XmakeCommonFlags.Trim())</_XmakeCommonFlags>
+ <_XmakeCommonFlags Condition="$(XmakeDiagnosis)">-D $(_XmakeCommonFlags.Trim())</_XmakeCommonFlags>
+ <_XmakeCommonFlags>$(_XmakeCommonFlags.Trim()) $(_XmakeProjectFlag)</_XmakeCommonFlags>
- <_XmakeBuilDir>$([MSBuild]::MakeRelative('$(XmakeProjectDir)', '$(XmakeBuilDir)').TrimEnd('/\'.ToCharArray()))</_XmakeBuilDir>
+ <_XmakeOutFlag>-o "$([MSBuild]::MakeRelative('$(XmakeProjectDirResolved)', '$(XmakeBuilDirResolved)').TrimEnd('/\'.ToCharArray()))"</_XmakeOutFlag>
<_XmakeConfigFlags>$(XmakeConfigFlags.Trim())</_XmakeConfigFlags>
- <_XmakeConfigFlags>-p $(XmakePlat) -m $(XmakeMode) -a $(XmakeArch) -o "$(_XmakeBuilDir)" $(_XmakeConfigFlags)</_XmakeConfigFlags>
+ <_XmakeConfigFlags>-p $(XmakePlat) -m $(XmakeMode) -a $(XmakeArch) $(_XmakeOutFlag) $(_XmakeConfigFlags.Trim())</_XmakeConfigFlags>
<_XmakeBuildFlags>$(XmakeBuildFlags.Trim())</_XmakeBuildFlags>
- <_XmakeBuildFlags Condition="$(XmakeWarning)">-w $(_XmakeBuildFlags)</_XmakeBuildFlags>
+ <_XmakeBuildFlags Condition="$(XmakeWarning)">-w $(_XmakeBuildFlags.Trim())</_XmakeBuildFlags>
+
+ <_XmakeBuildFileFlags>$(_XmakeBuildFlags.Trim())</_XmakeBuildFileFlags>
+ <_XmakeBuildFileFlags Condition="$(XmakeRebuildFile)">$(_XmakeBuildFileFlags.Trim()) -r</_XmakeBuildFileFlags>
<_XmakeCleanFlags>$(XmakeCleanFlags.Trim())</_XmakeCleanFlags>
<_XmakeBuildFlags>$(_XmakeBuildFlags.Trim())</_XmakeBuildFlags>
+ <_XmakeBuildFileFlags>$(_XmakeBuildFileFlags.Trim())</_XmakeBuildFileFlags>
<_XmakeCleanFlags>$(_XmakeCleanFlags.Trim())</_XmakeCleanFlags>
<_XmakeConfigFlags>$(_XmakeConfigFlags.Trim())</_XmakeConfigFlags>
<_XmakeCommonFlags>$(_XmakeCommonFlags.Trim())</_XmakeCommonFlags>
- <_XmakeExecutable>"$([System.IO.Path]::GetFullPath('$(XmakeProgramDir)xmake.exe'))"</_XmakeExecutable>
+ <_XmakeExecutable>"$([System.IO.Path]::GetFullPath('$(XmakeProgramDirResolved)xmake.exe'))"</_XmakeExecutable>
<_XmakeEnv>
chcp 65001 &gt; NUL
- set XMAKE_CONFIGDIR=$(XmakeConfigDir.TrimEnd('/\'.ToCharArray()))
- set XMAKE_PROGRAM_DIR=$(XmakeProgramDir.TrimEnd('/\'.ToCharArray()))
+ set XMAKE_CONFIGDIR=$(XmakeConfigDirResolved.TrimEnd('/\'.ToCharArray()))
+ set XMAKE_PROGRAM_DIR=$(XmakeProgramDirResolved.TrimEnd('/\'.ToCharArray()))
</_XmakeEnv>
</PropertyGroup>
@@ -45,44 +89,44 @@
Text="File '$(VCTargetsPath)\BuildCustomizations\CUDA $(XmakeCudaVersion).targets' not found" />
<Warning Condition="'$(XmakeCudaVersion)' != '' And !Exists('$(VCTargetsPath)\BuildCustomizations\CUDA $(XmakeCudaVersion).props')"
Text="File '$(VCTargetsPath)\BuildCustomizations\CUDA $(XmakeCudaVersion).props' not found" />
- <Error Condition="!Exists('$(XmakeProgramDir)\xmake.exe')"
- Text="xmake.exe not found at '$(XmakeProgramDir)', please set XMAKE_PROGRAM_DIR in environments or XmakeProgramDir in vcxproj file" />
- <Error Condition="'$(XmakeProjectFile)' == '' And !Exists('$(XmakeProjectDir)\xmake.lua')"
- Text="xmake.lua not found at '$(XmakeProjectDir)', please set XmakeProjectDir in vcxproj file" />
- <Error Condition="'$(XmakeProjectFile)' != '' And !Exists('$(XmakeProjectDir)\$(XmakeProjectFile)')"
- Text="$(XmakeProjectFile) not found at '$(XmakeProjectDir)', please set XmakeProjectDir in vcxproj file" />
+ <Error Condition="!Exists('$(XmakeProgramDirResolved)\xmake.exe')"
+ Text="xmake.exe not found at '$(XmakeProgramDirResolved)', please set XMAKE_PROGRAM_DIR in environments or XmakeProgramDir in vcxproj file" />
+ <Error Condition="'$(XmakeProjectFile)' == '' And !Exists('$(XmakeProjectDirResolved)\xmake.lua')"
+ Text="xmake.lua not found at '$(XmakeProjectDirResolved)', please set XmakeProjectDir in vcxproj file" />
+ <Error Condition="'$(XmakeProjectFile)' != '' And !Exists('$(XmakeProjectDirResolved)\$(XmakeProjectFile)')"
+ Text="$(XmakeProjectFile) not found at '$(XmakeProjectDirResolved)', please set XmakeProjectDir in vcxproj file" />
</Target>
<Target Name="_XmakeConfig" DependsOnTargets="_XmakeProjCheck">
<Message Text="$xmake config $(_XmakeCommonFlags) $(_XmakeConfigFlags) $(XmakeTarget)" Importance="High" />
- <Exec WorkingDirectory="$(XmakeProjectDir)" StdOutEncoding="utf-8" StdErrEncoding="utf-8" Command="$(_XmakeEnv)
+ <Exec WorkingDirectory="$(XmakeProjectDirResolved)" StdOutEncoding="utf-8" StdErrEncoding="utf-8" Command="$(_XmakeEnv)
$(_XmakeExecutable) config $(_XmakeCommonFlags) $(_XmakeConfigFlags) $(XmakeTarget)" EchoOff="true" />
</Target>
<Target Name="_XmakeReconfig" DependsOnTargets="_XmakeProjCheck">
<Message Text="$xmake config $(_XmakeCommonFlags) -c $(_XmakeConfigFlags) $(XmakeTarget)" Importance="High" />
- <Exec WorkingDirectory="$(XmakeProjectDir)" StdOutEncoding="utf-8" StdErrEncoding="utf-8" Command="$(_XmakeEnv)
+ <Exec WorkingDirectory="$(XmakeProjectDirResolved)" StdOutEncoding="utf-8" StdErrEncoding="utf-8" Command="$(_XmakeEnv)
$(_XmakeExecutable) config $(_XmakeCommonFlags) -c $(_XmakeConfigFlags) $(XmakeTarget)" EchoOff="true" />
</Target>
<Target Name="_XmakeBuild" DependsOnTargets="_XmakeProjCheck">
<Message Text="$xmake build $(_XmakeCommonFlags) $(_XmakeBuildFlags) $(XmakeTarget)" Importance="High" />
- <Exec WorkingDirectory="$(XmakeProjectDir)" StdOutEncoding="utf-8" StdErrEncoding="utf-8" Command="$(_XmakeEnv)
+ <Exec WorkingDirectory="$(XmakeProjectDirResolved)" StdOutEncoding="utf-8" StdErrEncoding="utf-8" Command="$(_XmakeEnv)
$(_XmakeExecutable) build $(_XmakeCommonFlags) $(_XmakeBuildFlags) $(XmakeTarget)" EchoOff="true" />
</Target>
<Target Name="_XmakeBuildFile" DependsOnTargets="_XmakeProjCheck">
<ItemGroup>
<SelectedFile Include="$(SelectedFiles)" />
- <File Include="$([MSBuild]::MakeRelative('$(XmakeProjectDir)', $([System.IO.Path]::GetFullPath('%(SelectedFile.Identity)'))))" />
+ <File Include="$([MSBuild]::MakeRelative('$(XmakeProjectDirResolved)', $([System.IO.Path]::GetFullPath('%(SelectedFile.Identity)'))))" />
</ItemGroup>
<PropertyGroup>
<FileList>@(File)</FileList>
<FileFlag>--files="$(FileList)"</FileFlag>
</PropertyGroup>
- <Message Text="$xmake build $(_XmakeCommonFlags) $(_XmakeBuildFlags) $(FileFlag) $(XmakeTarget)" Importance="High" />
- <Exec WorkingDirectory="$(XmakeProjectDir)" StdOutEncoding="utf-8" StdErrEncoding="utf-8" Command="$(_XmakeEnv)
- $(_XmakeExecutable) build $(_XmakeCommonFlags) $(_XmakeBuildFlags) $(FileFlag) $(XmakeTarget)" EchoOff="true" />
+ <Message Text="$xmake build $(_XmakeCommonFlags) $(_XmakeBuildFileFlags) $(FileFlag) $(XmakeTarget)" Importance="High" />
+ <Exec WorkingDirectory="$(XmakeProjectDirResolved)" StdOutEncoding="utf-8" StdErrEncoding="utf-8" Command="$(_XmakeEnv)
+ $(_XmakeExecutable) build $(_XmakeCommonFlags) $(_XmakeBuildFileFlags) $(FileFlag) $(XmakeTarget)" EchoOff="true" />
</Target>
<Target Name="_XmakeClean" DependsOnTargets="_XmakeProjCheck">
<Message Text="$xmake clean $(_XmakeCommonFlags) -a $(_XmakeCleanFlags) $(XmakeTarget)" Importance="High" />
- <Exec WorkingDirectory="$(XmakeProjectDir)" StdOutEncoding="utf-8" StdErrEncoding="utf-8" Command="$(_XmakeEnv)
+ <Exec WorkingDirectory="$(XmakeProjectDirResolved)" StdOutEncoding="utf-8" StdErrEncoding="utf-8" Command="$(_XmakeEnv)
$(_XmakeExecutable) clean $(_XmakeCommonFlags) -a $(_XmakeCleanFlags) $(XmakeTarget)" EchoOff="true" />
</Target>
@@ -99,6 +143,8 @@ MSBuild Properties:
XmakeMfcKind: $(XmakeMfcKind)
XmakeDefines: $(XmakeDefines)
XmakeLanguages: $(XmakeLanguages)
+ XmakeIncludeDir: $(XmakeIncludeDir)
+ XmakeLinkDir: $(XmakeLinkDir)
Xmake Path:
XmakeProgramDir: $(XmakeProgramDir)
XmakeProjectDir: $(XmakeProjectDir)
@@ -106,12 +152,18 @@ MSBuild Properties:
XmakeBuilDir: $(XmakeBuilDir)
XmakeConfigDir: $(XmakeConfigDir)
XmakeConfigFileDir: $(XmakeConfigFileDir)
- XmakeIncludeDir: $(XmakeIncludeDir)
- XmakeLinkDir: $(XmakeLinkDir)
+ Xmake Resolved Path:
+ XmakeProgramDir: $(XmakeProgramDirResolved)
+ XmakeProjectDir: $(XmakeProjectDirResolved)
+ XmakeScriptDir: $(XmakeScriptDirResolved)
+ XmakeBuilDir: $(XmakeBuilDirResolved)
+ XmakeConfigDir: $(XmakeConfigDirResolved)
+ XmakeConfigFileDir: $(XmakeConfigFileDirResolved)
Xmake Flags:
XmakeWarning: $(XmakeWarning)
XmakeVerbose: $(XmakeVerbose)
XmakeDiagnosis: $(XmakeDiagnosis)
+ XmakeRebuildFile: $(XmakeRebuildFile)
XmakeCommonFlags: $(XmakeCommonFlags)
XmakeConfigFlags: $(XmakeConfigFlags)
XmakeBuildFlags: $(XmakeBuildFlags)
@@ -120,6 +172,7 @@ MSBuild Properties:
_XmakeCommonFlags: $(_XmakeCommonFlags)
_XmakeConfigFlags: $(_XmakeConfigFlags)
_XmakeBuildFlags: $(_XmakeBuildFlags)
+ _XmakeBuildFileFlags: $(_XmakeBuildFileFlags)
_XmakeCleanFlags: $(_XmakeCleanFlags)
_XmakeExecutable: $(_XmakeExecutable)
_XmakeEnv: $(_XmakeEnv)
diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.xml b/xmake/plugins/project/vsxmake/vsproj/Xmake.xml
new file mode 100644
index 000000000..5e35da3ff
--- /dev/null
+++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ProjectSchemaDefinitions
+ xmlns="clr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Framework"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:sys="clr-namespace:System;assembly=mscorlib">
+ <Rule Name="XmakeConfiguration" DisplayName="Xmake" PageTemplate="generic" SwitchPrefix="--" Description="Xmake Properties">
+ <Rule.Categories>
+ <Category Name="Common" DisplayName="Common" Description="Xmake common configurations"/>
+ <Category Name="Flags" DisplayName="Additional flags" Description="Xmake additional flags"/>
+ <Category Name="Paths" DisplayName="Paths" Description="Xmake configurable paths"/>
+ </Rule.Categories>
+ <Rule.DataSource>
+ <DataSource Persistence="UserFile" Label="XmakeConfiguration"/>
+ </Rule.DataSource>
+
+ <BoolProperty
+ Name="XmakeVerbose"
+ DisplayName="Print verbose information"
+ Category="Common"
+ Description="Print lots of verbose information for users."
+ Switch="verbose" />
+ <BoolProperty
+ Name="XmakeDiagnosis"
+ DisplayName="Print diagnosis information"
+ Category="Common"
+ Description="Print lots of diagnosis information (backtrace, check info ..) only for developers."
+ Switch="diagnosis" />
+ <BoolProperty
+ Name="XmakeWarning"
+ DisplayName="Print warings"
+ Category="Common"
+ Description="Enable the warnings output for build tasks."
+ Switch="warning" />
+ <BoolProperty
+ Name="XmakeRebuildFile"
+ DisplayName="Force rebuild selected files"
+ Category="Common"
+ Description="When use 'compile' command to build selected files, add '--rebuild' flag to force rebuild files."
+ Switch="rebuild" />
+
+ <StringProperty
+ Name="XmakeCleanFlags"
+ DisplayName="Clean flags"
+ Category="Flags"
+ Description="Additional flags for 'xmake clean'" />
+ <StringProperty
+ Name="XmakeBuildFlags"
+ DisplayName="Build flags"
+ Category="Flags"
+ Description="Additional flags for 'xmake build'" />
+ <StringProperty
+ Name="XmakeConfigFlags"
+ DisplayName="Config flags"
+ Category="Flags"
+ Description="Additional flags for 'xmake config'" />
+ <StringProperty
+ Name="XmakeCommonFlags"
+ DisplayName="Common flags"
+ Category="Flags"
+ Description="Additional flags for all xmake call" />
+
+ <StringProperty
+ Name="XmakeConfigDir"
+ DisplayName="Config dir"
+ Category="Paths"
+ Description="Set environment XMAKE_CONFIGDIR for xmake tasks"
+ Subtype="folder" />
+ <StringProperty
+ Name="XmakeBuilDir"
+ DisplayName="Build dir"
+ Category="Paths"
+ Description="Set output dir for xmake tasks"
+ Subtype="folder" />
+ </Rule>
+
+</ProjectSchemaDefinitions>
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/#target#.vcxproj.user b/xmake/plugins/project/vsxmake/vsproj/templates/#target#.vcxproj.user
deleted file mode 100644
index a994443e1..000000000
--- a/xmake/plugins/project/vsxmake/vsproj/templates/#target#.vcxproj.user
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <LocalDebuggerCommandArguments></LocalDebuggerCommandArguments>
- <LocalDebuggerWorkingDirectory>$(XmakeRunDir)</LocalDebuggerWorkingDirectory>
- <LocalDebuggerEnvironment>$(XmakeRunEnvs)
-$(LocalDebuggerEnvironment)</LocalDebuggerEnvironment>
- <LocalDebuggerMergeEnvironment>true</LocalDebuggerMergeEnvironment>
- </PropertyGroup>
-</Project> \ No newline at end of file
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.props b/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.props
index 55f596456..eaff91446 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.props
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.props
@@ -34,17 +34,20 @@
<!-- Set -D for all xmake call -->
<!-- <XmakeDiagnosis Condition="'$(XmakeDiagnosis)' == ''">false</XmakeDiagnosis> -->
+ <!-- Set -r for "xmake build" for selected files -->
+ <!-- <XmakeRebuildFile Condition="'$(XmakeRebuildFile)' == ''">false</XmakeRebuildFile> -->
+
<!-- Additional flags for "xmake clean" -->
- <XmakeCleanFlags>$(XmakeCleanflags)</XmakeCleanFlags>
+ <!-- <XmakeCleanFlags>$(XmakeCleanflags)</XmakeCleanFlags> -->
<!-- Additional flags for "xmake build" -->
- <XmakeBuildFlags>$(XmakeBuildFlags)</XmakeBuildFlags>
+ <!-- <XmakeBuildFlags>$(XmakeBuildFlags)</XmakeBuildFlags> -->
<!-- Additional flags for "xmake config" -->
- <XmakeConfigFlags>$(XmakeConfigFlags)</XmakeConfigFlags>
+ <!-- <XmakeConfigFlags>$(XmakeConfigFlags)</XmakeConfigFlags> -->
<!-- Additional flags for all xmake call -->
- <XmakeCommonFlags>$(XmakeCommonFlags)</XmakeCommonFlags>
+ <!-- <XmakeCommonFlags>$(XmakeCommonFlags)</XmakeCommonFlags> -->
</PropertyGroup>
</Project>
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.c(filec) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.c(filec)
index 020488ce4..79327d35d 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.c(filec)
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.c(filec)
@@ -1,3 +1,3 @@
- <ClCompile Include="$(XmakeProjectDir)#path#">
+ <ClCompile Include="$(XmakeProjectDir)\#path#">
<Filter>#dir#</Filter>
</ClCompile>
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cu(filecu) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cu(filecu)
index 520e88430..189e6d220 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cu(filecu)
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cu(filecu)
@@ -1,3 +1,3 @@
- <CudaCompile Include="$(XmakeProjectDir)#path#">
+ <CudaCompile Include="$(XmakeProjectDir)\#path#">
<Filter>#dir#</Filter>
</CudaCompile>
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cxx(filecxx) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cxx(filecxx)
index 020488ce4..79327d35d 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cxx(filecxx)
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cxx(filecxx)
@@ -1,3 +1,3 @@
- <ClCompile Include="$(XmakeProjectDir)#path#">
+ <ClCompile Include="$(XmakeProjectDir)\#path#">
<Filter>#dir#</Filter>
</ClCompile>
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.obj(fileobj) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.obj(fileobj)
index 5ee8281b7..e62ea9e9e 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.obj(fileobj)
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.obj(fileobj)
@@ -1,3 +1,3 @@
- <Object Include="$(XmakeProjectDir)#path#">
+ <Object Include="$(XmakeProjectDir)\#path#">
<Filter>#dir#</Filter>
</Object>
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.rc(filerc) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.rc(filerc)
index c1118ab55..f7bd9969f 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.rc(filerc)
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.rc(filerc)
@@ -1,3 +1,3 @@
- <ResourceCompile Include="$(XmakeProjectDir)#path#">
+ <ResourceCompile Include="$(XmakeProjectDir)\#path#">
<Filter>#dir#</Filter>
</ResourceCompile>
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/Include(inc) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/Include(inc)
index 3a21dc7bf..8c9e8a547 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/Include(inc)
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/Include(inc)
@@ -1,3 +1,3 @@
- <ClInclude Include="$(XmakeProjectDir)#path#">
+ <ClInclude Include="$(XmakeProjectDir)\#path#">
<Filter>#dir#</Filter>
</ClInclude>
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.c(filec) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.c(filec)
index 68c1a7d5b..5a9bc59f3 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.c(filec)
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.c(filec)
@@ -1,3 +1,3 @@
- <ClCompile Include="$(XmakeProjectDir)#path#">
+ <ClCompile Include="$(XmakeProjectDir)\#path#">
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cu(filecu) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cu(filecu)
index 1d1d98f7d..ee6f7ffce 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cu(filecu)
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cu(filecu)
@@ -1 +1 @@
- <CudaCompile Include="$(XmakeProjectDir)#path#" />
+ <CudaCompile Include="$(XmakeProjectDir)\#path#" />
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cxx(filecxx) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cxx(filecxx)
index a8534b74b..92a8b031f 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cxx(filecxx)
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cxx(filecxx)
@@ -1,3 +1,3 @@
- <ClCompile Include="$(XmakeProjectDir)#path#">
+ <ClCompile Include="$(XmakeProjectDir)\#path#">
<CompileAs>CompileAsCpp</CompileAs>
</ClCompile>
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.obj(fileobj) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.obj(fileobj)
index 5c858884d..2e1c1ed1d 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.obj(fileobj)
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.obj(fileobj)
@@ -1 +1 @@
- <Object Include="$(XmakeProjectDir)#path#" />
+ <Object Include="$(XmakeProjectDir)\#path#" />
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.rc(filerc) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.rc(filerc)
index e15b89bbe..34612f2ef 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.rc(filerc)
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.rc(filerc)
@@ -1 +1 @@
- <ResourceCompile Include="$(XmakeProjectDir)#path#" />
+ <ResourceCompile Include="$(XmakeProjectDir)\#path#" />
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/Include(inc) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/Include(inc)
index dfd5df637..ddafd770a 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/Include(inc)
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/Include(inc)
@@ -1 +1 @@
- <ClInclude Include="$(XmakeProjectDir)#path#" />
+ <ClInclude Include="$(XmakeProjectDir)\#path#" />
diff --git a/xmake/plugins/project/vsxmake/vsxmake.lua b/xmake/plugins/project/vsxmake/vsxmake.lua
index 2526b00cb..d38465489 100644
--- a/xmake/plugins/project/vsxmake/vsxmake.lua
+++ b/xmake/plugins/project/vsxmake/vsxmake.lua
@@ -30,7 +30,6 @@ local template_sln = path.join(template_root, "sln", "vsxmake.sln")
local template_vcx = path.join(template_root, "vcxproj", "#target#.vcxproj")
local template_fil = path.join(template_root, "vcxproj.filters", "#target#.vcxproj.filters")
-local template_usr = path.join(template_root, "#target#.vcxproj.user")
local template_props = path.join(template_root, "Xmake.Custom.props")
local template_targets = path.join(template_root, "Xmake.Custom.targets")
local template_items = path.join(template_root, "Xmake.Custom.items")
@@ -168,8 +167,6 @@ function make(version)
_trycp(template_targets, proj_dir)
_trycp(template_items, proj_dir)
_trycp(template_itemfil, proj_dir)
- -- add project user file
- _trycp(template_usr, proj_dir, target .. ".vcxproj.user")
end
end
end