diff --git a/modules/vstudio/tests/vc2010/test_files.lua b/modules/vstudio/tests/vc2010/test_files.lua
index bda03222..d5d10e83 100644
--- a/modules/vstudio/tests/vc2010/test_files.lua
+++ b/modules/vstudio/tests/vc2010/test_files.lua
@@ -107,11 +107,13 @@
-- Check handling of buildaction.
--
function suite.customBuildTool_onBuildAction()
- files { "test.x", "test2.cpp", "test3.cpp" }
+ files { "test.x", "test2.cpp", "test3.cpp", "test4.dll" }
filter "files:**.x"
buildaction "FxCompile"
filter "files:test2.cpp"
buildaction "None"
+ filter { "files:test4.dll" }
+ buildaction "Copy"
prepare()
test.capture [[
@@ -122,6 +124,12 @@
+
+
+
+ bin\Debug
+ bin\Release
+
]]
end
diff --git a/modules/vstudio/vs2010_vcxproj.lua b/modules/vstudio/vs2010_vcxproj.lua
index 5befe7c6..8df673f7 100644
--- a/modules/vstudio/vs2010_vcxproj.lua
+++ b/modules/vstudio/vs2010_vcxproj.lua
@@ -1085,6 +1085,28 @@
end
}
+---
+-- Copy group
+---
+
+ m.categories.Copy = {
+ name = "Copy",
+ priority = 13,
+
+ emitFiles = function(prj, group)
+ local fileCfgFunc = {
+ m.excludedFromBuild,
+ m.destinationFolders
+ }
+
+ m.emitFiles(prj, group, "CopyFileToFolders", nil, fileCfgFunc)
+ end,
+
+ emitFilter = function(prj, group)
+ m.filterGroup(prj, group, "CopyFileToFolders")
+ end
+ }
+
---
-- Categorize files into groups.
---
@@ -1836,6 +1858,13 @@
end
+ function m.destinationFolders(filecfg, condition)
+ if filecfg then
+ m.element("DestinationFolders", condition, vstudio.path(filecfg.config, filecfg.config.buildtarget.directory))
+ end
+ end
+
+
function m.enableDpiAwareness(cfg)
local awareness = {
None = "false",
diff --git a/website/docs/buildaction.md b/website/docs/buildaction.md
index 01291ef0..e5a9c409 100644
--- a/website/docs/buildaction.md
+++ b/website/docs/buildaction.md
@@ -8,6 +8,21 @@ buildaction ("action")
For C/C++, `action` is the name of the MSBuild action as defined by the vcxproj format; eg: `ClCompile`, `FxCompile`, `None`, etc, and may refer to any such action available to MSBuild.
+| Action | Description |
+|-----------------|----------------------------------------------------------------------------------|
+| ClInclude | Treat the file as an include file. |
+| ClCompile | Treat the file as source code; compile and link it. |
+| FxCompile | Treat the file as HLSL shader source code; compile and link it. |
+| None | Do nothing with this file. |
+| ResourceCompile | Copy/embed the file with the project resources. |
+| CustomBuild | Treat the file as custom build code; compile and optionally link it. |
+| Midl | Treat the file as MIDL source code; compile and link it. |
+| Masm | Treat the file as MASM source code; compile and link it. |
+| Image | Treat the file as an Image. |
+| Natvis | Treat the file as Natvis source; use it for custom data layouts while debugging. |
+| AppxManifest | Treat the file as AppX Manifest; required for UWP applications. |
+| Copy | Copy the file to the target directory. |
+
For C# projects, `buildaction` behaviour is special to support legacy implementation.
In C#, `action` is one of