summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-07-18 10:04:03 +0800
committerOpportunityLiu <[email protected]>2019-07-19 11:48:32 +0800
commitc9f0e8a551778e185b1fb92f2bb07d8cc3581f95 (patch)
treea4efc9a280911256d2ea57d992e95f17e7ca870c
parent33729fbb22f06ec784cbabf9fe06847a6077e86c (diff)
rename file; support cuda build selected file
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/Xmake.props12
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/Xmake.targets9
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.items (renamed from xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.files)0
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.items.filters (renamed from xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.files.filters)0
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters4
-rw-r--r--xmake/plugins/project/vsxmake/vsxmake.lua8
6 files changed, 20 insertions, 13 deletions
diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.props b/xmake/plugins/project/vsxmake/vsproj/Xmake.props
index ac84bf1d7..e954a435b 100644
--- a/xmake/plugins/project/vsxmake/vsproj/Xmake.props
+++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.props
@@ -145,14 +145,14 @@
Include="$(MSBuildProjectDirectory)\Xmake.Custom.props" />
<None Condition="Exists('$(MSBuildProjectDirectory)\Xmake.Custom.targets')"
Include="$(MSBuildProjectDirectory)\Xmake.Custom.targets" />
- <None Condition="Exists('$(MSBuildProjectDirectory)\Xmake.Custom.files')"
- Include="$(MSBuildProjectDirectory)\Xmake.Custom.files" />
- <None Condition="Exists('$(MSBuildProjectDirectory)\Xmake.Custom.files.filters')"
- Include="$(MSBuildProjectDirectory)\Xmake.Custom.files.filters" />
+ <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.files')"
- Project="$(MSBuildProjectDirectory)\Xmake.Custom.files" />
+ <Import Condition="Exists('$(MSBuildProjectDirectory)\Xmake.Custom.items')"
+ Project="$(MSBuildProjectDirectory)\Xmake.Custom.items" />
</Project>
diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
index 940490271..0f4b287f5 100644
--- a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
+++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
@@ -139,6 +139,7 @@ MSBuild Properties:
PreprocessorDefinitions: %(ClCompile.PreprocessorDefinitions)
LanguageStandard: %(ClCompile.LanguageStandard)
SelectedFiles: $(SelectedFiles)
+ VCTargetsPath: $(VCTargetsPath)
" Importance="High" />
</Target>
@@ -177,12 +178,18 @@ MSBuild Properties:
<Target Name="BeforeBuildFiles" />
<Target Name="AfterBuildFiles" />
- <Target Name="ClCompile">
+ <Target Name="BuildFiles" Condition="'$(DesignTimeBuild)' != 'true'">
<CallTarget Targets="Show" Condition="$(XmakeDiagnosis)" />
<CallTarget Targets="BeforeBuildFiles" />
<CallTarget Targets="_XmakeConfig;_XmakeBuildFile" />
<CallTarget Targets="AfterBuildFiles" />
</Target>
+ <Target Name="ClCompile">
+ <CallTarget Targets="BuildFiles" />
+ </Target>
+ <Target Name="CudaBuild">
+ <CallTarget Targets="BuildFiles" />
+ </Target>
<ImportGroup Label="CustomTargets">
<!--only search 2 levels to avoid accidentally import-->
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.files b/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.items
index a894e8d0d..a894e8d0d 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.files
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.items
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.files.filters b/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.items.filters
index f69e1abb7..f69e1abb7 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.files.filters
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.items.filters
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters
index 80a13f280..ce686b448 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters
@@ -21,10 +21,10 @@
<None Include="$(MSBuildProjectDirectory)\Xmake.Custom.targets">
<Filter>Properties</Filter>
</None>
- <None Include="$(MSBuildProjectDirectory)\Xmake.Custom.files">
+ <None Include="$(MSBuildProjectDirectory)\Xmake.Custom.items">
<Filter>Properties</Filter>
</None>
- <None Include="$(MSBuildProjectDirectory)\Xmake.Custom.files.filters">
+ <None Include="$(MSBuildProjectDirectory)\Xmake.Custom.items.filters">
<Filter>Properties</Filter>
</None>
<None Include="$(XmakeScriptDir)\xmake.lua">
diff --git a/xmake/plugins/project/vsxmake/vsxmake.lua b/xmake/plugins/project/vsxmake/vsxmake.lua
index 6fe5bce24..ac9e27c85 100644
--- a/xmake/plugins/project/vsxmake/vsxmake.lua
+++ b/xmake/plugins/project/vsxmake/vsxmake.lua
@@ -32,8 +32,8 @@ local template_fil = path.join(template_root, "vcxproj.filters", "#target#.vcxpr
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_files = path.join(template_root, "Xmake.Custom.files")
-local template_filefil = path.join(template_root, "Xmake.Custom.files.filters")
+local template_items = path.join(template_root, "Xmake.Custom.items")
+local template_itemfil = path.join(template_root, "Xmake.Custom.items.filters")
function _filter_files(files, exts)
local extset = hashset.from(exts)
@@ -160,8 +160,8 @@ function make(version)
-- add project custom file
_trycp(template_props, proj_dir)
_trycp(template_targets, proj_dir)
- _trycp(template_files, proj_dir)
- _trycp(template_filefil, 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