Merge pull request #1113 from Blizzard/buildaction_for_cpp
Support buildaction for C++ projects
This commit is contained in:
commit
fddc822c8b
@ -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.
|
||||
--
|
||||
|
@ -1028,13 +1028,19 @@
|
||||
|
||||
|
||||
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 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
|
||||
|
||||
-- If there is a custom rule associated with it, use that
|
||||
|
@ -58,17 +58,6 @@
|
||||
name = "buildaction",
|
||||
scope = "config",
|
||||
kind = "string",
|
||||
allowed = {
|
||||
"Application",
|
||||
"Compile",
|
||||
"Component",
|
||||
"Copy",
|
||||
"Embed",
|
||||
"Form",
|
||||
"None",
|
||||
"Resource",
|
||||
"UserControl",
|
||||
},
|
||||
}
|
||||
|
||||
api.register {
|
||||
|
Loading…
Reference in New Issue
Block a user