diff options
| author | ruki <[email protected]> | 2023-11-29 00:58:55 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-11-29 00:58:55 +0800 |
| commit | ba06a7763de8a5a75984b1f8c3c514c6d44e3211 (patch) | |
| tree | 48023b108f8c23a6730e075a18c147bfe404137f /xmake/scripts/vsxmake | |
| parent | 0c66e771ba66bad764c264467c5e7fd2f2c34add (diff) | |
improve vsxmake xpack
Diffstat (limited to 'xmake/scripts/vsxmake')
39 files changed, 912 insertions, 0 deletions
diff --git a/xmake/scripts/vsxmake/vsproj/Xmake.Defaults.props b/xmake/scripts/vsxmake/vsproj/Xmake.Defaults.props new file mode 100644 index 000000000..702647639 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/Xmake.Defaults.props @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + + <PropertyGroup Label="XmakePathsResolve"> + <_XmakeProgramDir>$(XmakeProgramDir)</_XmakeProgramDir> + <_XmakeProjectDir>$(XmakeProjectDir)</_XmakeProjectDir> + <_XmakeScriptDir>$(XmakeScriptDir)</_XmakeScriptDir> + + <!-- resolve if they are relative paths --> + <_XmakeProgramDir Condition="!$([System.IO.Path]::IsPathRooted('$(_XmakeProgramDir)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(_XmakeProgramDir)'))</_XmakeProgramDir> + <_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> + + <!-- normalize paths --> + <XmakeProgramDir>$([System.IO.Path]::GetFullPath('$(_XmakeProgramDir)'))</XmakeProgramDir> + <XmakeProjectDir>$([System.IO.Path]::GetFullPath('$(_XmakeProjectDir)'))</XmakeProjectDir> + <XmakeScriptDir>$([System.IO.Path]::GetFullPath('$(_XmakeScriptDir)'))</XmakeScriptDir> + </PropertyGroup> + +</Project> diff --git a/xmake/scripts/vsxmake/vsproj/Xmake.props b/xmake/scripts/vsxmake/vsproj/Xmake.props new file mode 100644 index 000000000..3e3a33298 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/Xmake.props @@ -0,0 +1,200 @@ +<?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> + <XmakeMode Condition="'$(XmakeMode)' == ''">release</XmakeMode> + + <XmakeArch Condition="'$(XmakeArch)' == '' And '$(Platform.ToLower())' == 'win32'">x86</XmakeArch> + <XmakeArch Condition="'$(XmakeArch)' == '' And '$(Platform.ToLower())' != 'win32'">$(Platform)</XmakeArch> + <XmakeArch Condition="'$(XmakeArch)' == ''">x86</XmakeArch> + </PropertyGroup> + + <ImportGroup Label="CustomSettings"> + <!--only search 2 levels to avoid accidentally import--> + <Import Condition="Exists('$(MSBuildProjectDirectory)\Xmake.Custom.props')" + Project="$(MSBuildProjectDirectory)\Xmake.Custom.props" /> + <Import Condition="!Exists('$(MSBuildProjectDirectory)\Xmake.Custom.props') And Exists('$(MSBuildProjectDirectory)\..\Xmake.Custom.props')" + Project="$(MSBuildProjectDirectory)\..\Xmake.Custom.props" /> + </ImportGroup> + + <PropertyGroup Label="XmakePropsFallback"> + <XmakeBasename Condition="'$(XmakeBasename)' == ''">$(XmakeTarget)</XmakeBasename> + <XmakeBasename Condition="'$(XmakeBasename)' == ''">$(TargetName)</XmakeBasename> + <XmakeBasename Condition="'$(XmakeBasename)' == ''">$(MSBuildProjectName)</XmakeBasename> + + <XmakeKind Condition="'$(XmakeKind)' == ''">binary</XmakeKind> + <XmakePlat Condition="'$(XmakePlat)' == ''">windows</XmakePlat> + </PropertyGroup> + + <PropertyGroup Label="XmakePathsFallback"> + <XmakeBuilDir Condition="'$(XmakeBuilDir)' == ''">$(XmakeProjectDir)\build</XmakeBuilDir> + <XmakeTargetDir Condition="'$(XmakeTargetDir)' == ''">$(XmakeBuilDir)\$(XmakePlat)\$(XmakeArch)\$(XmakeMode)</XmakeTargetDir> + <XmakeConfigFileDir Condition="'$(XmakeConfigFileDir)' == ''">$(XmakeBuilDir)\$(XmakePlat)\$(XmakeArch)\$(XmakeMode)</XmakeConfigFileDir> + + <XmakeConfigDir Condition="'$(XmakeConfigDir)' == ''">$(XMAKE_CONFIGDIR)</XmakeConfigDir> + <XmakeConfigDir Condition="'$(XmakeConfigDir)' == ''">$(XmakeProjectDir)</XmakeConfigDir> + + <XmakeRunDir Condition="'$(XmakeRunDir)' == ''">$(XmakeTargetDir)</XmakeRunDir> + </PropertyGroup> + + <PropertyGroup Label="XmakeFlagsFallback"> + <XmakeCleanAll Condition="'$(XmakeCleanAll)' == ''">true</XmakeCleanAll> + <XmakeWarning Condition="'$(XmakeWarning)' == ''">true</XmakeWarning> + <XmakeVerbose Condition="'$(XmakeVerbose)' == ''">false</XmakeVerbose> + <XmakeDiagnosis Condition="'$(XmakeDiagnosis)' == ''">false</XmakeDiagnosis> + <XmakeRebuildFile Condition="'$(XmakeRebuildFile)' == ''">false</XmakeRebuildFile> + </PropertyGroup> + + <PropertyGroup Condition="'$(WindowsTargetPlatformVersion)' == '' And '$(XmakeWindowsSdkVersion)' != ''"> + <WindowsTargetPlatformVersion>$(XmakeWindowsSdkVersion)</WindowsTargetPlatformVersion> + </PropertyGroup> + + <PropertyGroup Condition="'$(PlatformToolset)' == ''"> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0'">v120</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0'">v140</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> + </PropertyGroup> + + <PropertyGroup Label="AdditionalProps"> + <UseOfMfc Condition="'$(XmakeMfcKind)' != ''">$(XmakeMfcKind)</UseOfMfc> + <CharacterSet Condition="'$(CharacterSet)' == '' And ($(XmakeDefines.Contains(';UNICODE;')) Or $(XmakeDefines.EndsWith(';UNICODE')) Or $(XmakeDefines.StartsWith('UNICODE;')) Or $(XmakeDefines.Equals('UNICODE')))">Unicode</CharacterSet> + <CharacterSet Condition="'$(CharacterSet)' == ''">MultiByte</CharacterSet> + </PropertyGroup> + + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <Choose> + <When Condition="'$(XmakeKind)' == 'binary'"> + <PropertyGroup> + <ConfigurationType>Application</ConfigurationType> + </PropertyGroup> + </When> + <When Condition="'$(XmakeKind)' == 'shared'"> + <PropertyGroup> + <ConfigurationType>DynamicLibrary</ConfigurationType> + </PropertyGroup> + </When> + <When Condition="'$(XmakeKind)' == 'static'"> + <PropertyGroup> + <ConfigurationType>StaticLibrary</ConfigurationType> + </PropertyGroup> + </When> + <When Condition="'$(XmakeKind)' == 'phony'"> + <PropertyGroup> + <ConfigurationType>Unknown</ConfigurationType> + </PropertyGroup> + </When> + <When Condition="'$(XmakeKind)' == 'headeronly'"> + <PropertyGroup> + <ConfigurationType>Unknown</ConfigurationType> + </PropertyGroup> + </When> + </Choose> + + <ItemDefinitionGroup> + <ClCompile> + <PreprocessorDefinitions>%(PreprocessorDefinitions);$(XmakeDefines)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>$(XmakeIncludeDirs)</AdditionalIncludeDirectories> + <AdditionalOptions>%(AdditionalOptions) $(XmakeCFlags) $(XmakeCXFlags) $(XmakeCXXFlags)</AdditionalOptions> + <LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('cxx11'))">stdcpp11</LanguageStandard> + <LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('cxx14'))">stdcpp14</LanguageStandard> + <LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('cxx17'))">stdcpp17</LanguageStandard> + <LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('cxx1z'))">stdcpp17</LanguageStandard> + <LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('cxx20'))">stdcpplatest</LanguageStandard> + <LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('cxx2a'))">stdcpplatest</LanguageStandard> + <LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('cxx23'))">stdcpplatest</LanguageStandard> + <LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('cxx2b'))">stdcpplatest</LanguageStandard> + <LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('cxxlatest'))">stdcpplatest</LanguageStandard> + <LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('gnuxx11'))">stdcpp11</LanguageStandard> + <LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('gnuxx14'))">stdcpp14</LanguageStandard> + <LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('gnuxx17'))">stdcpp17</LanguageStandard> + <LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('gnuxx1z'))">stdcpp17</LanguageStandard> + <LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('gnuxx20'))">stdcpplatest</LanguageStandard> + <LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('gnuxx2a'))">stdcpplatest</LanguageStandard> + <LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('gnuxx23'))">stdcpplatest</LanguageStandard> + <LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('gnuxx2b'))">stdcpplatest</LanguageStandard> + <LanguageStandard_C Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('c11'))">stdc11</LanguageStandard_C> + <LanguageStandard_C Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('c17'))">stdc17</LanguageStandard_C> + <LanguageStandard_C Condition="'%(LanguageStandard_C)' == '' And $(XmakeLanguages.Contains('gnu11'))">stdc11</LanguageStandard_C> + <LanguageStandard_C Condition="'%(LanguageStandard_C)' == '' And $(XmakeLanguages.Contains('gnu17'))">stdc17</LanguageStandard_C> + <PrecompiledHeader Condition="'%(PrecompiledHeader)' == '' And $(XmakePrecompiledHeader.Contains('.h'))">Use</PrecompiledHeader> + <PrecompiledHeaderFile Condition="'%(PrecompiledHeaderFile)' == '' And $(XmakePrecompiledHeader.Contains('.h'))">$(XmakeProjectDir)\$(XmakePrecompiledHeader)</PrecompiledHeaderFile> + <ForcedIncludeFiles Condition="'%(ForcedIncludeFiles)' == '' And $(XmakePrecompiledHeader.Contains('.h'))">$(XmakeProjectDir)\$(XmakePrecompiledHeader);%(ForcedIncludeFiles)</ForcedIncludeFiles> + </ClCompile> + + <Link> + <SubSystem Condition="'%(SubSystem)' == '' And $(XmakeSubSystem.Contains('console'))">Console</SubSystem> + <SubSystem Condition="'%(SubSystem)' == '' And $(XmakeSubSystem.Contains('windows'))">Windows</SubSystem> + </Link> + + <ResourceCompile> + <PreprocessorDefinitions>%(PreprocessorDefinitions);$(XmakeDefines)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>$(XmakeIncludeDirs)</AdditionalIncludeDirectories> + </ResourceCompile> + </ItemDefinitionGroup> + + <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" /> + </ImportGroup> + + <ImportGroup Label="PropertySheets"> + <Import Condition="Exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" + Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" /> + </ImportGroup> + + <PropertyGroup Label="GlobalsFallback"> + <TargetName Condition="'$(XmakeFilename)' == ''">$(XmakeBasename)</TargetName> + <TargetName Condition="'$(XmakeFilename)' != ''">$([System.IO.Path]::GetFileNameWithoutExtension('$(XmakeFilename)'))</TargetName> + <TargetExt Condition="'$(XmakeFilename)' != ''">$([System.IO.Path]::GetExtension('$(XmakeFilename)'))</TargetExt> + </PropertyGroup> + + <PropertyGroup Label="Path"> + <LibraryPath>$(XmakeLinkDirs);$(LibraryPath)</LibraryPath> + <OutDir>$(XmakeTargetDir)\</OutDir> + <IntDir>$(XmakeBuilDir)\.vs\$(TargetName)\$(XmakeArch)\$(XmakeMode)\</IntDir> + <SourcePath>$(XmakeSourceDirs);$(SourcePath)</SourcePath> + </PropertyGroup> + + <PropertyGroup Label="Debugger"> + <LocalDebuggerWorkingDirectory>$(XmakeRunDir)</LocalDebuggerWorkingDirectory> + <LocalDebuggerEnvironment>$(XmakeRunEnvs) +$(LocalDebuggerEnvironment)</LocalDebuggerEnvironment> + <LocalDebuggerCommandArguments>$(XmakeRunArgs)</LocalDebuggerCommandArguments> + <LocalDebuggerMergeEnvironment>true</LocalDebuggerMergeEnvironment> + <RemoteDebuggerWorkingDirectory>$(XmakeRunDir)</RemoteDebuggerWorkingDirectory> + <RemoteDebuggerEnvironment>$(XmakeRunEnvs) +$(RemoteDebuggerEnvironment)</RemoteDebuggerEnvironment> + <RemoteDebuggerCommandArguments>$(XmakeRunArgs)</RemoteDebuggerCommandArguments> + </PropertyGroup> + + <!-- Common files --> + <ItemGroup> + <None Condition="Exists('$(MSBuildProjectDirectory)\Xmake.Custom.props')" + Include="$(MSBuildProjectDirectory)\Xmake.Custom.props" /> + <None Condition="Exists('$(MSBuildProjectDirectory)\Xmake.Custom.targets')" + Include="$(MSBuildProjectDirectory)\Xmake.Custom.targets" /> + <None Condition="Exists('$(MSBuildProjectDirectory)\Xmake.Custom.items')" + Include="$(MSBuildProjectDirectory)\Xmake.Custom.items" /> + <None Condition="Exists('$(MSBuildProjectDirectory)\Xmake.Custom.items.filters')" + Include="$(MSBuildProjectDirectory)\Xmake.Custom.items.filters" /> + <None Condition="'$(XmakeScriptDir)' != '$(XmakeProjectDir)' And Exists('$(XmakeScriptDir)\xmake.lua')" + Include="$(XmakeScriptDir)\xmake.lua" /> + </ItemGroup> + + <Import Condition="Exists('$(MSBuildProjectDirectory)\Xmake.Custom.items')" + Project="$(MSBuildProjectDirectory)\Xmake.Custom.items" /> +</Project> diff --git a/xmake/scripts/vsxmake/vsproj/Xmake.targets b/xmake/scripts/vsxmake/vsproj/Xmake.targets new file mode 100644 index 000000000..55f6b1fd2 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/Xmake.targets @@ -0,0 +1,264 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + <Import Condition="'$(XmakeCudaVersion)' != '' And Exists('$(VCTargetsPath)\BuildCustomizations\CUDA $(XmakeCudaVersion).targets')" + Project="$(VCTargetsPath)\BuildCustomizations\CUDA $(XmakeCudaVersion).targets" /> + </ImportGroup> + + <PropertyGroup Label="XmakePathsResolve"> + <XmakeBuilDirResolved>$(XmakeBuilDir)</XmakeBuilDirResolved> + <XmakeTargetDirResolved>$(XmakeTargetDir)</XmakeTargetDirResolved> + <XmakeConfigDirResolved>$(XmakeConfigDir)</XmakeConfigDirResolved> + <XmakeConfigFileDirResolved>$(XmakeConfigFileDir)</XmakeConfigFileDirResolved> + <XmakeRunDirResolved>$(XmakeRunDir)</XmakeRunDirResolved> + + <!-- resolve if they are relative paths --> + <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 --> + <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> + + <!-- these paths resolved in Xmake.Default.props, just normalize --> + <XmakeProgramDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeProgramDir)/'))</XmakeProgramDirResolved> + <XmakeProjectDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeProjectDir)/'))</XmakeProjectDirResolved> + <XmakeScriptDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeScriptDir)/'))</XmakeScriptDirResolved> + </PropertyGroup> + + <PropertyGroup Label="XmakeInternal"> + <_XmakeProjectFlag Condition="'$(XmakeProjectFile)' != ''">-F "$(XmakeProjectFile)"</_XmakeProjectFlag> + <_XmakeProjectFlag Condition="'$(XmakeProjectFile)' == ''">-P .</_XmakeProjectFlag> + + <_XmakeCommonFlags>$(XmakeCommonFlags.Trim())</_XmakeCommonFlags> + <_XmakeCommonFlags Condition="$(XmakeVerbose)">-v $(_XmakeCommonFlags.Trim())</_XmakeCommonFlags> + <_XmakeCommonFlags Condition="$(XmakeDiagnosis)">-D $(_XmakeCommonFlags.Trim())</_XmakeCommonFlags> + <_XmakeCommonFlags>-y $(_XmakeCommonFlags.Trim()) $(_XmakeProjectFlag)</_XmakeCommonFlags> + + <_XmakeOutFlag>-o "$([MSBuild]::MakeRelative('$(XmakeProjectDirResolved)', '$(XmakeBuilDirResolved)').TrimEnd('\').TrimEnd('/'))"</_XmakeOutFlag> + + <_XmakeConfigFlags>$(XmakeConfigFlags.Trim())</_XmakeConfigFlags> + <_XmakeConfigFlags>-p $(XmakePlat) -m $(XmakeMode) -a $(XmakeArch) $(_XmakeOutFlag) $(_XmakeConfigFlags.Trim())</_XmakeConfigFlags> + + <_XmakeBuildFlags>$(XmakeBuildFlags.Trim())</_XmakeBuildFlags> + <_XmakeBuildFlags Condition="$(XmakeWarning)">-w $(_XmakeBuildFlags.Trim())</_XmakeBuildFlags> + + <_XmakeBuildFileFlags>$(_XmakeBuildFlags.Trim())</_XmakeBuildFileFlags> + <_XmakeBuildFileFlags Condition="$(XmakeRebuildFile)">$(_XmakeBuildFileFlags.Trim()) -r</_XmakeBuildFileFlags> + + <_XmakeCleanFlags>$(XmakeCleanFlags.Trim())</_XmakeCleanFlags> + <_XmakeCleanFlags Condition="$(XmakeCleanAll)">-a $(_XmakeCleanFlags.Trim())</_XmakeCleanFlags> + + <_XmakeBuildFlags>$(_XmakeBuildFlags.Trim())</_XmakeBuildFlags> + <_XmakeBuildFileFlags>$(_XmakeBuildFileFlags.Trim())</_XmakeBuildFileFlags> + <_XmakeCleanFlags>$(_XmakeCleanFlags.Trim())</_XmakeCleanFlags> + <_XmakeConfigFlags>$(_XmakeConfigFlags.Trim())</_XmakeConfigFlags> + <_XmakeCommonFlags>$(_XmakeCommonFlags.Trim())</_XmakeCommonFlags> + <_XmakeTarget>"$(XmakeTarget.Trim())"</_XmakeTarget> + + <_XmakeExecutable>"$([System.IO.Path]::GetFullPath('$(XmakeProgramDirResolved)xmake.exe'))"</_XmakeExecutable> + <_XmakeEnv> + pushd $(XmakeProjectDirResolved) + set XMAKE_CONFIGDIR=$(XmakeConfigDirResolved.TrimEnd('\').TrimEnd('/')) + set XMAKE_PROGRAM_DIR=$(XmakeProgramDirResolved.TrimEnd('\').TrimEnd('/')) + set XMAKE_SKIP_HISTORY=1 + set XMAKE_IN_VSTUDIO=1 + </_XmakeEnv> + <_XmakeEnv Condition="$(XmakeDiagnosis)"> + $(_XmakeEnv) + echo XMAKE_CONFIGDIR=%25XMAKE_CONFIGDIR%25 + echo XMAKE_PROGRAM_DIR=%25XMAKE_PROGRAM_DIR%25 + echo CD=%25CD%25 + </_XmakeEnv> + </PropertyGroup> + + <Target Name="_XmakeProjCheck"> + <Warning Condition="'$(XmakeCudaVersion)' != '' And !Exists('$(VCTargetsPath)\BuildCustomizations\CUDA $(XmakeCudaVersion).targets')" + 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('$(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)" Importance="High" /> + <Exec Command="$(_XmakeEnv) + $(_XmakeExecutable) config $(_XmakeCommonFlags) $(_XmakeConfigFlags)" EchoOff="true" /> + </Target> + <Target Name="_XmakeBuild" DependsOnTargets="_XmakeProjCheck"> + <Message Text="$xmake build $(_XmakeCommonFlags) $(_XmakeBuildFlags) $(_XmakeTarget)" Importance="High" /> + <Exec Command="$(_XmakeEnv) + $(_XmakeExecutable) build $(_XmakeCommonFlags) $(_XmakeBuildFlags) $(_XmakeTarget)" EchoOff="true" /> + </Target> + <Target Name="_XmakeRebuild" DependsOnTargets="_XmakeProjCheck"> + <Message Text="$xmake build -r $(_XmakeCommonFlags) $(_XmakeBuildFlags) $(_XmakeTarget)" Importance="High" /> + <Exec Command="$(_XmakeEnv) + $(_XmakeExecutable) build -r $(_XmakeCommonFlags) $(_XmakeBuildFlags) $(_XmakeTarget)" EchoOff="true" /> + </Target> + <Target Name="_XmakeBuildFile" DependsOnTargets="_XmakeProjCheck"> + <ItemGroup> + <SelectedFile Include="$(SelectedFiles)" /> + <File Include="$([MSBuild]::MakeRelative('$(XmakeProjectDirResolved)', $([System.IO.Path]::GetFullPath('%(SelectedFile.Identity)'))))" /> + </ItemGroup> + <PropertyGroup> + <FileFlag>--files="@(File)"</FileFlag> + </PropertyGroup> + <Message Text="$xmake build $(_XmakeCommonFlags) $(_XmakeBuildFileFlags) $(FileFlag) $(_XmakeTarget)" Importance="High" /> + <Exec Command="$(_XmakeEnv) + $(_XmakeExecutable) build $(_XmakeCommonFlags) $(_XmakeBuildFileFlags) $(FileFlag) $(_XmakeTarget)" EchoOff="true" /> + </Target> + <Target Name="_XmakeClean" DependsOnTargets="_XmakeProjCheck"> + <Message Text="$xmake clean $(_XmakeCommonFlags) $(_XmakeCleanFlags) $(_XmakeTarget)" Importance="High" /> + <Exec Command="$(_XmakeEnv) + $(_XmakeExecutable) clean $(_XmakeCommonFlags) $(_XmakeCleanFlags) $(_XmakeTarget)" EchoOff="true" /> + </Target> + + <Target Name="Show"> + <Message Text=" +MSBuild Properties: + Xmake Props: + XmakeTarget: $(XmakeTarget) + 'XmakePlat|Mode|Arch': '$(XmakePlat)|$(XmakeMode)|$(XmakeArch)' + XmakeBasename: $(XmakeBasename) + XmakeFilename: $(XmakeFilename) + XmakeKind: $(XmakeKind) + XmakeDefault: $(XmakeDefault) + XmakeCudaVersion: $(XmakeCudaVersion) + XmakeWindowsSdkVersion: $(XmakeWindowsSdkVersion) + XmakeMfcKind: $(XmakeMfcKind) + XmakeDefines: $(XmakeDefines) + XmakeCFlags: $(XmakeCFlags) + XmakeCXFlags: $(XmakeCXFlags) + XmakeCXXFlags: $(XmakeCXXFlags) + XmakeLanguages: $(XmakeLanguages) + XmakeSubSystem: $(XmakeSubSystem) + XmakeIncludeDirs: $(XmakeIncludeDirs) + XmakeLinkDirs: $(XmakeLinkDirs) + XmakeSourceDirs: $(XmakeSourceDirs) + XmakePrecompiledHeader: $(XmakePrecompiledHeader) + XmakeRunEnvs: $(XmakeRunEnvs) + XmakeRunArgs: $(XmakeRunArgs) + Xmake Path: + XmakeProgramDir: $(XmakeProgramDir) + XmakeProjectDir: $(XmakeProjectDir) + XmakeScriptDir: $(XmakeScriptDir) + XmakeBuilDir: $(XmakeBuilDir) + XmakeTargetDir: $(XmakeTargetDir) + XmakeConfigDir: $(XmakeConfigDir) + XmakeConfigFileDir: $(XmakeConfigFileDir) + XmakeRunDir: $(XmakeRunDir) + Xmake Resolved Path: + XmakeProgramDir: $(XmakeProgramDirResolved) + XmakeProjectDir: $(XmakeProjectDirResolved) + XmakeScriptDir: $(XmakeScriptDirResolved) + XmakeBuilDir: $(XmakeBuilDirResolved) + XmakeTargetDir: $(XmakeTargetDirResolved) + XmakeConfigDir: $(XmakeConfigDirResolved) + XmakeConfigFileDir: $(XmakeConfigFileDirResolved) + XmakeRunDir: $(XmakeRunDirResolved) + Xmake Flags: + XmakeWarning: $(XmakeWarning) + XmakeVerbose: $(XmakeVerbose) + XmakeDiagnosis: $(XmakeDiagnosis) + XmakeRebuildFile: $(XmakeRebuildFile) + XmakeCleanAll: $(XmakeCleanAll) + XmakeCommonFlags: $(XmakeCommonFlags) + XmakeConfigFlags: $(XmakeConfigFlags) + XmakeBuildFlags: $(XmakeBuildFlags) + XmakeCleanFlags: $(XmakeCleanFlags) + Xmake Internal: + _XmakeCommonFlags: $(_XmakeCommonFlags) + _XmakeConfigFlags: $(_XmakeConfigFlags) + _XmakeBuildFlags: $(_XmakeBuildFlags) + _XmakeBuildFileFlags: $(_XmakeBuildFileFlags) + _XmakeCleanFlags: $(_XmakeCleanFlags) + _XmakeExecutable: $(_XmakeExecutable) + _XmakeEnv: $(_XmakeEnv) + Vs Props: + 'Configuration|Platform': '$(Configuration)|$(Platform)' + VisualStudioVersion: $(VisualStudioVersion) + MSBuildProjectDirectory: $(MSBuildProjectDirectory) + MSBuildProjectName: $(MSBuildProjectName) + OutDir: $(OutDir) + IntDir: $(IntDir) + SourcePath: $(SourcePath) + TargetName: $(TargetName) + TargetExt: $(TargetExt) + PlatformToolset: $(PlatformToolset) + CharacterSet: $(CharacterSet) + UseOfMfc: $(UseOfMfc) + WindowsTargetPlatformVersion: $(WindowsTargetPlatformVersion) + PreprocessorDefinitions: %(ClCompile.PreprocessorDefinitions) + LanguageStandard: %(ClCompile.LanguageStandard) + SelectedFiles: $(SelectedFiles) + VCTargetsPath: $(VCTargetsPath) + " Importance="High" /> + </Target> + + <Target Name="BeforeBuild" /> + <Target Name="AfterBuild" /> + <Target Name="Build" Condition="'$(DesignTimeBuild)' != 'true'"> + <CallTarget Targets="Show" Condition="$(XmakeDiagnosis)" /> + <CallTarget Targets="BeforeBuild" /> + <CallTarget Targets="_XmakeConfig;_XmakeBuild" /> + <CallTarget Targets="AfterBuild" /> + </Target> + + <Target Name="BeforeClean" /> + <Target Name="AfterClean" /> + <Target Name="Clean" Condition="'$(DesignTimeBuild)' != 'true'"> + <CallTarget Targets="Show" Condition="$(XmakeDiagnosis)" /> + <CallTarget Targets="BeforeClean" /> + <CallTarget Targets="_XmakeConfig;_XmakeClean" /> + <CallTarget Targets="AfterClean" /> + </Target> + + <Target Name="BeforeRebuild" /> + <Target Name="AfterRebuild" /> + <Target Name="Rebuild" Condition="'$(DesignTimeBuild)' != 'true'"> + <CallTarget Targets="Show" Condition="$(XmakeDiagnosis)" /> + <CallTarget Targets="BeforeRebuild" /> + <CallTarget Targets="_XmakeConfig;_XmakeRebuild" /> + <CallTarget Targets="AfterRebuild" /> + </Target> + + + <Target Name="BeforeBuildFiles" /> + <Target Name="AfterBuildFiles" /> + <Target Name="BuildFiles" Condition="'$(DesignTimeBuild)' != 'true'"> + <CallTarget Targets="Show" Condition="$(XmakeDiagnosis)" /> + <CallTarget Targets="BeforeBuildFiles" /> + <CallTarget Targets="_XmakeConfig;_XmakeBuildFile" /> + <CallTarget Targets="AfterBuildFiles" /> + </Target> + <!-- override default compile commands --> + <Target Name="ClCompile" Condition="'$(DesignTimeBuild)' != 'true'"> + <CallTarget Targets="BuildFiles" /> + </Target> + <Target Name="ResourceCompile" Condition="'$(DesignTimeBuild)' != 'true'"> + <CallTarget Targets="BuildFiles" /> + </Target> + <Target Name="CudaBuild" Condition="'$(DesignTimeBuild)' != 'true'"> + <CallTarget Targets="BuildFiles" /> + </Target> + + <ImportGroup Label="CustomTargets"> + <!--only search 2 levels to avoid accidentally import--> + <Import Condition="Exists('$(MSBuildProjectDirectory)\Xmake.Custom.targets')" + Project="$(MSBuildProjectDirectory)\Xmake.Custom.targets" /> + <Import Condition="!Exists('$(MSBuildProjectDirectory)\Xmake.Custom.targets') And Exists('$(MSBuildProjectDirectory)\..\Xmake.Custom.targets')" + Project="$(MSBuildProjectDirectory)\..\Xmake.Custom.targets" /> + </ImportGroup> +</Project> diff --git a/xmake/scripts/vsxmake/vsproj/Xmake.xml b/xmake/scripts/vsxmake/vsproj/Xmake.xml new file mode 100644 index 000000000..11dddabec --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/Xmake.xml @@ -0,0 +1,82 @@ +<?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 warnings" + Category="Common" + Description="Enable the warnings output for build tasks." + Switch="warning" /> + <BoolProperty + Name="XmakeCleanAll" + DisplayName="Clean all" + Category="Common" + Description="Clean all auto-generated files by xmake for clean tasks." + Switch="all" /> + <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/scripts/vsxmake/vsproj/templates/Xmake.Custom.items b/xmake/scripts/vsxmake/vsproj/templates/Xmake.Custom.items new file mode 100644 index 000000000..a894e8d0d --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/Xmake.Custom.items @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <!-- + Use this file to include custom files for visual studio projects. + + This file will be imported by .vcxproj + --> + <ItemGroup> + <!-- <None Include="$(XmakeProjectDir)\xxx\yyy\zzz" /> --> + </ItemGroup> +</Project> diff --git a/xmake/scripts/vsxmake/vsproj/templates/Xmake.Custom.items.filters b/xmake/scripts/vsxmake/vsproj/templates/Xmake.Custom.items.filters new file mode 100644 index 000000000..f69e1abb7 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/Xmake.Custom.items.filters @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <!-- + Use this file to include custom files for visual studio projects. + + This file will be imported by .vcxproj.filters + --> + <ItemGroup> + <!-- <None Include="$(XmakeProjectDir)\xxx\yyy\zzz"> + <Filter>xxx\yyy</Filter> + </None> --> + </ItemGroup> +</Project> diff --git a/xmake/scripts/vsxmake/vsproj/templates/Xmake.Custom.props b/xmake/scripts/vsxmake/vsproj/templates/Xmake.Custom.props new file mode 100644 index 000000000..d6aa9927e --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/Xmake.Custom.props @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <!-- inherit parent settings --> + <Import Condition="Exists('$(MSBuildThisFileDirectory)\..\Xmake.Custom.props')" + Project="$(MSBuildThisFileDirectory)\..\Xmake.Custom.props" /> + + <PropertyGroup Label="XmakePaths"> + <!-- set environment XMAKE_CONFIGDIR for xmake tasks --> + <!-- <XmakeConfigDir Condition="'$(XmakeMode)|$(XmakeArch)' == 'release|x86'">$(XmakeProjectDir)\.xmake</XmakeConfigDir> --> + + <!-- set output dir for xmake tasks --> + <!-- <XmakeBuilDir>$(XmakeProjectDir)\build</XmakeBuilDir> --> + </PropertyGroup> + + <PropertyGroup Label="XmakeFlags"> + <!-- Configure these flags to customize xmake build process --> + <!-- + Inherit parents: + <XmakeCleanFlags>$(XmakeCleanflags) -D</XmakeCleanFlags> + Override parents: + <XmakeCleanFlags>-D</XmakeCleanFlags> + Respect parents: + <XmakeCleanFlags Condition=" '$(XmakeCleanFlags)' == '' ">-D</XmakeCleanFlags> + + For -w, -v and -D, use <XmakeWarning>, <XmakeVerbose> and <XmakeDiagnosis> is more convenient. + --> + + <!-- Set -a for "xmake clean" --> + <!-- <XmakeCleanAll Condition="'$(XmakeCleanAll)' == ''">true</XmakeWarning> --> + + <!-- Set -w for "xmake build" --> + <!-- <XmakeWarning Condition="'$(XmakeWarning)' == ''">true</XmakeWarning> --> + + <!-- Set -v for all xmake call --> + <!-- <XmakeVerbose Condition="'$(XmakeVerbose)' == ''">false</XmakeVerbose> --> + + <!-- 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> --> + + <!-- Additional flags for "xmake build" --> + <!-- <XmakeBuildFlags>$(XmakeBuildFlags)</XmakeBuildFlags> --> + + <!-- Additional flags for "xmake config" --> + <!-- <XmakeConfigFlags>$(XmakeConfigFlags)</XmakeConfigFlags> --> + + <!-- Additional flags for all xmake call --> + <!-- <XmakeCommonFlags>$(XmakeCommonFlags)</XmakeCommonFlags> --> + </PropertyGroup> +</Project> diff --git a/xmake/scripts/vsxmake/vsproj/templates/Xmake.Custom.targets b/xmake/scripts/vsxmake/vsproj/templates/Xmake.Custom.targets new file mode 100644 index 000000000..8a5153db8 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/Xmake.Custom.targets @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <!-- inherit parent settings --> + <Import Condition="Exists('$(MSBuildThisFileDirectory)\..\Xmake.Custom.targets')" + Project="$(MSBuildThisFileDirectory)\..\Xmake.Custom.targets" /> + + <!-- Override these targets to customize your build workflow --> + <!-- + If you uncomment targets below, + targets with same name that comes from ../Xmake.Custom.targets will be overrided. + + You can also define your own targets and call them like: + <Target Name="BeforeBuild"> + <CallTarget Targets="CustomStep1;CustomStep2" /> + </Target> + + To find task that you can used in custom targets, + see: https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-task-reference + --> + + <!-- <Target Name="BeforeRebuild"></Target> --> + <!-- <Target Name="AfterRebuild"></Target> --> + <!-- <Target Name="BeforeBuild"></Target> --> + <!-- <Target Name="AfterBuild"></Target> --> + <!-- <Target Name="BeforeClean"></Target> --> + <!-- <Target Name="AfterClean"></Target> --> + <!-- <Target Name="BeforeBuildFiles"></Target> --> + <!-- <Target Name="AfterBuildFiles"></Target> --> +</Project> diff --git a/xmake/scripts/vsxmake/vsproj/templates/sln/ProjConfig(target,mode,arch) b/xmake/scripts/vsxmake/vsproj/templates/sln/ProjConfig(target,mode,arch) new file mode 100644 index 000000000..20ed12788 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/sln/ProjConfig(target,mode,arch) @@ -0,0 +1,2 @@ + {#target_id#}.#mode#|#arch#.ActiveCfg = #mode#|#vsarch#@default=true; + {#target_id#}.#mode#|#arch#.Build.0 = #mode#|#vsarch#@ diff --git a/xmake/scripts/vsxmake/vsproj/templates/sln/Project(target) b/xmake/scripts/vsxmake/vsproj/templates/sln/Project(target) new file mode 100644 index 000000000..11e743c8a --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/sln/Project(target) @@ -0,0 +1,2 @@ +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "#target#", "#target#\#target#.vcxproj", "{#target_id#}" +EndProject diff --git a/xmake/scripts/vsxmake/vsproj/templates/sln/ProjectGroup(group) b/xmake/scripts/vsxmake/vsproj/templates/sln/ProjectGroup(group) new file mode 100644 index 000000000..2a32553a7 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/sln/ProjectGroup(group) @@ -0,0 +1,2 @@ +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "#group#", "#group#", "{#group_id#}" +EndProject diff --git a/xmake/scripts/vsxmake/vsproj/templates/sln/ProjectGroupConfig(group_dep) b/xmake/scripts/vsxmake/vsproj/templates/sln/ProjectGroupConfig(group_dep) new file mode 100644 index 000000000..d08963bfb --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/sln/ProjectGroupConfig(group_dep) @@ -0,0 +1 @@ + {#current_id#} = {#parent_id#} diff --git a/xmake/scripts/vsxmake/vsproj/templates/sln/SlnConfig(mode,arch) b/xmake/scripts/vsxmake/vsproj/templates/sln/SlnConfig(mode,arch) new file mode 100644 index 000000000..b1784b846 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/sln/SlnConfig(mode,arch) @@ -0,0 +1 @@ + #mode#|#arch# = #mode#|#arch# diff --git a/xmake/scripts/vsxmake/vsproj/templates/sln/vsxmake.sln b/xmake/scripts/vsxmake/vsproj/templates/sln/vsxmake.sln new file mode 100644 index 000000000..49bbcd708 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/sln/vsxmake.sln @@ -0,0 +1,35 @@ +Microsoft Visual Studio Solution File, Format Version #solution_version#.00 +# Visual Studio Version #vs_version# +# +# #xmake_info# +# +# This file is auto generated by xmake. +# +# Please DO NOT EDIT since all your modification will lost after re-generation. +# See https://github.com/xmake-io/xmake/pull/472 for more infomation. +# +VisualStudioVersion = #vs_version# +MinimumVisualStudioVersion = 10.0.40219.1 +#Import(Project)# +#Import(ProjectGroup)# +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Properties", "Properties", "{007754BD-BB1F-452F-A0D8-13EF216C5ED9}" + ProjectSection(SolutionItems) = preProject + Xmake.Custom.props = Xmake.Custom.props + Xmake.Custom.targets = Xmake.Custom.targets + #sln_projectfile# = #sln_projectfile# + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +#Import(SlnConfig)# EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +#Import(ProjConfig)# EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution +#Import(ProjectGroupConfig)# EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {#solution_id#} + EndGlobalSection +EndGlobal diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters new file mode 100644 index 000000000..eee3d1a12 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +#xmake_info# + + This file is auto generated by xmake. + + Please DO NOT EDIT since all your modification will lost after re-generation. + See https://github.com/xmake-io/xmake/pull/472 for more infomation. +--> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Properties"> + <UniqueIdentifier>{CC7C6180-942D-056E-3227-E6A2B3FB19CD}</UniqueIdentifier> + </Filter> +#Import(Filter)# + </ItemGroup> + <ItemGroup> + <None Include="$(MSBuildProjectDirectory)\Xmake.Custom.props"> + <Filter>Properties</Filter> + </None> + <None Include="$(MSBuildProjectDirectory)\Xmake.Custom.targets"> + <Filter>Properties</Filter> + </None> + <None Include="$(MSBuildProjectDirectory)\Xmake.Custom.items"> + <Filter>Properties</Filter> + </None> + <None Include="$(MSBuildProjectDirectory)\Xmake.Custom.items.filters"> + <Filter>Properties</Filter> + </None> + <None Include="$(XmakeScriptDir)\xmake.lua"> + <Filter>Properties</Filter> + </None> + </ItemGroup> + <ItemGroup> +#Import(Include.c)# +#Import(Include.natvis)# + </ItemGroup> + <ItemGroup> +#Import(File.c)# +#Import(File.cxx)# +#Import(File.mpp)# +#Import(File.cu)# + </ItemGroup> + <ItemGroup> +#Import(File.obj)# + </ItemGroup> + <ItemGroup> +#Import(File.rc)# +#Import(File.ui)# + </ItemGroup> + <Import Condition="Exists('$(MSBuildThisFileDirectory)\Xmake.Custom.files.filters')" + Project="$(MSBuildThisFileDirectory)\Xmake.Custom.files.filters" /> +</Project> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.c(filec) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.c(filec) new file mode 100644 index 000000000..134ee2b62 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.c(filec) @@ -0,0 +1,3 @@ + <ClCompile Include="#path#"> + <Filter>#dir#</Filter> + </ClCompile> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.cu(filecu) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.cu(filecu) new file mode 100644 index 000000000..9e7ce6858 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.cu(filecu) @@ -0,0 +1,3 @@ + <CudaCompile Include="#path#"> + <Filter>#dir#</Filter> + </CudaCompile> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.cxx(filecxx) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.cxx(filecxx) new file mode 100644 index 000000000..134ee2b62 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.cxx(filecxx) @@ -0,0 +1,3 @@ + <ClCompile Include="#path#"> + <Filter>#dir#</Filter> + </ClCompile> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.mpp(filempp) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.mpp(filempp) new file mode 100644 index 000000000..134ee2b62 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.mpp(filempp) @@ -0,0 +1,3 @@ + <ClCompile Include="#path#"> + <Filter>#dir#</Filter> + </ClCompile> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.obj(fileobj) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.obj(fileobj) new file mode 100644 index 000000000..f0039d2d5 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.obj(fileobj) @@ -0,0 +1,3 @@ + <Object Include="#path#"> + <Filter>#dir#</Filter> + </Object> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.rc(filerc) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.rc(filerc) new file mode 100644 index 000000000..c0b9568e6 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.rc(filerc) @@ -0,0 +1,3 @@ + <ResourceCompile Include="#path#"> + <Filter>#dir#</Filter> + </ResourceCompile> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.ui(fileui) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.ui(fileui) new file mode 100644 index 000000000..9aee25191 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/File.ui(fileui) @@ -0,0 +1,3 @@ + <None Include="#path#"> + <Filter>#dir#</Filter> + </None> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/Filter(dir) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/Filter(dir) new file mode 100644 index 000000000..763e5e83c --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/Filter(dir) @@ -0,0 +1,3 @@ + <Filter Include="#dir#"> + <UniqueIdentifier>{#dir_id#}</UniqueIdentifier> + </Filter> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/Include.c(incc) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/Include.c(incc) new file mode 100644 index 000000000..36908e21f --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/Include.c(incc) @@ -0,0 +1,3 @@ + <ClInclude Include="#path#"> + <Filter>#dir#</Filter> + </ClInclude> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/Include.natvis(incnatvis) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/Include.natvis(incnatvis) new file mode 100644 index 000000000..f0787a035 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj.filters/Include.natvis(incnatvis) @@ -0,0 +1,3 @@ + <Natvis Include="#path#"> + <Filter>#dir#</Filter> + </Natvis>
\ No newline at end of file diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj new file mode 100644 index 000000000..b194ce86c --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +#xmake_info# + + This file is auto generated by xmake. + + Please DO NOT EDIT since all your modification will lost after re-generation. + If you would like to have any customization, + edit Xmake.Custom.props and Xmake.Custom.targets instead. + + See https://github.com/xmake-io/xmake/pull/472 for more infomation. +--> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> +#Import(ProjectConfiguration)# + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{#target_id#}</ProjectGuid> + <Configuration Condition="'$(Configuration)' == ''">release</Configuration> + <Platform Condition="'$(Platform)' == ''">Win32</Platform> + <XmakeScriptDir>#scriptdir#</XmakeScriptDir> + <XmakeProjectDir>#projectdir#</XmakeProjectDir> + <XmakeProjectFile>#projectfile#</XmakeProjectFile> + <XmakeTarget>#target#</XmakeTarget> + </PropertyGroup> + <PropertyGroup Label="XmakeProgram"> + <XmakeProgramDir Condition="'$(XmakeProgramDir)' == ''">$(XMAKE_PROGRAM_DIR)</XmakeProgramDir> + <XmakeProgramDir Condition="'$(XmakeProgramDir)' == ''">#programdir#</XmakeProgramDir> + </PropertyGroup> + <Import Project="$(XmakeProgramDir)\scripts\vsxmake\vsproj\Xmake.Defaults.props" /> +#Import(XmakeConfig)# +#Import(XmakePath)# + <Import Project="$(XmakeProgramDir)\scripts\vsxmake\vsproj\Xmake.props" /> + <ItemGroup> +#Import(Include.c)# +#Import(Include.natvis)# + </ItemGroup> + <ItemGroup> +#Import(File.c)# +#Import(File.cxx)# +#Import(File.mpp)# +#Import(File.cu)# + </ItemGroup> + <ItemGroup> +#Import(File.obj)# + </ItemGroup> + <ItemGroup> +#Import(File.rc)# +#Import(File.ui)# + </ItemGroup> + <!-- <ItemGroup> +#Import(ProjectRef)# + </ItemGroup> --> + <Import Project="$(XmakeProgramDir)\scripts\vsxmake\vsproj\Xmake.targets" /> +</Project> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.c(filec) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.c(filec) new file mode 100644 index 000000000..7bb854de9 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.c(filec) @@ -0,0 +1,3 @@ + <ClCompile Include="#path#"> + <CompileAs>CompileAsC</CompileAs> + </ClCompile> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.cu(filecu) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.cu(filecu) new file mode 100644 index 000000000..72be50b63 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.cu(filecu) @@ -0,0 +1 @@ + <CudaCompile Include="#path#" /> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.cxx(filecxx) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.cxx(filecxx) new file mode 100644 index 000000000..c1bf2e626 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.cxx(filecxx) @@ -0,0 +1,3 @@ + <ClCompile Include="#path#"> + <CompileAs>CompileAsCpp</CompileAs> + </ClCompile> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.mpp(filempp) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.mpp(filempp) new file mode 100644 index 000000000..7c435b1c6 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.mpp(filempp) @@ -0,0 +1,3 @@ + <ClCompile Include="#path#"> + <CompileAs>CompileAsCppModule</CompileAs> + </ClCompile> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.obj(fileobj) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.obj(fileobj) new file mode 100644 index 000000000..7cefaca84 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.obj(fileobj) @@ -0,0 +1 @@ + <Object Include="#path#" /> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.rc(filerc) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.rc(filerc) new file mode 100644 index 000000000..7ffa8591b --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.rc(filerc) @@ -0,0 +1 @@ + <ResourceCompile Include="#path#" /> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.ui(fileui) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.ui(fileui) new file mode 100644 index 000000000..6429fe3e9 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/File.ui(fileui) @@ -0,0 +1 @@ + <None Include="#path#" /> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj/Include.c(incc) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/Include.c(incc) new file mode 100644 index 000000000..e50fbb7a0 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/Include.c(incc) @@ -0,0 +1 @@ + <ClInclude Include="#path#" /> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj/Include.natvis(incnatvis) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/Include.natvis(incnatvis) new file mode 100644 index 000000000..533f394ab --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/Include.natvis(incnatvis) @@ -0,0 +1,3 @@ + <Natvis Include="#path#"> + <FileType>Document</FileType> + </Natvis>
\ No newline at end of file diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj/ProjectConfiguration(mode,arch) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/ProjectConfiguration(mode,arch) new file mode 100644 index 000000000..d6956bf15 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/ProjectConfiguration(mode,arch) @@ -0,0 +1,4 @@ + <ProjectConfiguration Include="#mode#|#vsarch#"> + <Configuration>#mode#</Configuration> + <Platform>#vsarch#</Platform> + </ProjectConfiguration> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj/ProjectRef(dep) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/ProjectRef(dep) new file mode 100644 index 000000000..33434eca3 --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/ProjectRef(dep) @@ -0,0 +1,3 @@ + <ProjectReference Include="..\#target#\#target#.vcxproj"> + <Project>{#target_id#}</Project> + </ProjectReference> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj/XmakeConfig(mode,arch) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/XmakeConfig(mode,arch) new file mode 100644 index 000000000..5fa6d0f0f --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/XmakeConfig(mode,arch) @@ -0,0 +1,25 @@ + <PropertyGroup Label="XmakeConfig" Condition="'$(Configuration)|$(Platform)'=='#mode#|#vsarch#'"> + <XmakeBasename>#basename#</XmakeBasename> + <XmakeFilename>#filename#</XmakeFilename> + <XmakeMode>#mode#</XmakeMode> + <XmakePlat>#plat#</XmakePlat> + <XmakeArch>#arch#</XmakeArch> + <XmakeKind>#kind#</XmakeKind> + <XmakeDefault>#default#</XmakeDefault> + <XmakeDefines>#defines#</XmakeDefines> + <XmakeLanguages>#languages#</XmakeLanguages> + <XmakeSubSystem>#subsystem#</XmakeSubSystem> + <XmakeCudaVersion>#cudaver#</XmakeCudaVersion> + <XmakeWindowsSdkVersion>#sdkver#</XmakeWindowsSdkVersion> + <XmakeMfcKind>#mfckind#</XmakeMfcKind> + <XmakeRunEnvs>#runenvs#</XmakeRunEnvs> + <XmakeRunArgs>#runargs#</XmakeRunArgs> + <XmakeConfigFlags>#configflags#</XmakeConfigFlags> + <XmakeIncludeDirs>#includedirs#</XmakeIncludeDirs> + <XmakeLinkDirs>#linkdirs#</XmakeLinkDirs> + <XmakeSourceDirs>#sourcedirs#</XmakeSourceDirs> + <XmakePrecompiledHeader>#pcheaderfile#</XmakePrecompiledHeader> + <XmakeCFlags>#cflags#</XmakeCFlags> + <XmakeCXFlags>#cxflags#</XmakeCXFlags> + <XmakeCXXFlags>#cxxflags#</XmakeCXXFlags> + </PropertyGroup> diff --git a/xmake/scripts/vsxmake/vsproj/templates/vcxproj/XmakePath(mode,arch) b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/XmakePath(mode,arch) new file mode 100644 index 000000000..9afa8460f --- /dev/null +++ b/xmake/scripts/vsxmake/vsproj/templates/vcxproj/XmakePath(mode,arch) @@ -0,0 +1,7 @@ + <PropertyGroup Label="XmakePath" Condition="'$(Configuration)|$(Platform)'=='#mode#|#vsarch#'"> + <XmakeBuilDir>#buildir#</XmakeBuilDir> + <XmakeConfigDir>#configdir#</XmakeConfigDir> + <XmakeConfigFileDir>#configfiledir#</XmakeConfigFileDir> + <XmakeTargetDir>#targetdir#</XmakeTargetDir> + <XmakeRunDir>#rundir#</XmakeRunDir> + </PropertyGroup> |
