Merge pull request #1113 from Blizzard/buildaction_for_cpp

Support buildaction for C++ projects
This commit is contained in:
Manu Evans 2018-06-08 17:22:38 -07:00 committed by GitHub
commit fddc822c8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 15 deletions

View File

@ -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 [[
<ItemGroup>
<ClCompile Include="test3.cpp" />
</ItemGroup>
<ItemGroup>
<FxCompile Include="test.x" />
</ItemGroup>
<ItemGroup>
<None Include="test2.cpp" />
</ItemGroup>
]]
end
--
-- Check handling of files with custom build rules.
--

View File

@ -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

View File

@ -58,17 +58,6 @@
name = "buildaction",
scope = "config",
kind = "string",
allowed = {
"Application",
"Compile",
"Component",
"Copy",
"Embed",
"Form",
"None",
"Resource",
"UserControl",
},
}
api.register {