diff --git a/modules/vstudio/tests/vc2010/test_files.lua b/modules/vstudio/tests/vc2010/test_files.lua index 9e6e67e2..51019fad 100644 --- a/modules/vstudio/tests/vc2010/test_files.lua +++ b/modules/vstudio/tests/vc2010/test_files.lua @@ -90,6 +90,30 @@ end +-- +-- Check handling of buildaction. +-- + function suite.customBuildTool_onBuildAction() + files { "test.x", "test2.cpp", "test3.cpp" } + filter "files:**.x" + buildaction "FxCompile" + filter "files:test2.cpp" + buildaction "None" + prepare() + test.capture [[ + + + + + + + + + + ]] + end + + -- -- Check handling of files with custom build rules. -- diff --git a/modules/vstudio/vs2010_vcxproj.lua b/modules/vstudio/vs2010_vcxproj.lua index 85ead404..3c316f53 100644 --- a/modules/vstudio/vs2010_vcxproj.lua +++ b/modules/vstudio/vs2010_vcxproj.lua @@ -1028,12 +1028,18 @@ function m.categorizeFile(prj, file) - -- If any configuration for this file uses a custom build step, - -- that's the category to use for cfg in project.eachconfig(prj) do local fcfg = fileconfig.getconfig(file, cfg) - if fileconfig.hasCustomBuildRule(fcfg) then - return m.categories.CustomBuild + if fcfg then + -- If any configuration for this file uses a custom build step, that's the category to use + if fileconfig.hasCustomBuildRule(fcfg) then + return m.categories.CustomBuild + end + + -- also check for buildaction + if fcfg.buildaction then + return m.categories[fcfg.buildaction] or m.categories.None + end end end diff --git a/src/_premake_init.lua b/src/_premake_init.lua index eac9fe1c..6700d776 100644 --- a/src/_premake_init.lua +++ b/src/_premake_init.lua @@ -58,17 +58,6 @@ name = "buildaction", scope = "config", kind = "string", - allowed = { - "Application", - "Compile", - "Component", - "Copy", - "Embed", - "Form", - "None", - "Resource", - "UserControl", - }, } api.register {