Bug 2814179: Xbox 360 precompiled headers not working

This commit is contained in:
starkos 2009-06-30 00:08:16 +00:00
parent f64502c3c5
commit 0bb039fb4f
4 changed files with 87 additions and 15 deletions

View File

@ -10,6 +10,7 @@
-------
- Bug 2813297: OS X universal config should be "univ" (William Burnson)
- Bug 2814179: Xbox 360 precompiled headers not working
-----

View File

@ -25,18 +25,17 @@
"tools/ow.lua",
"base/validate.lua",
"base/help.lua",
"actions/codeblocks/_codeblocks.lua",
"actions/codeblocks/codeblocks_workspace.lua",
"actions/codeblocks/codeblocks_cbp.lua",
"actions/codelite/_codelite.lua",
"actions/codeblocks/_codeblocks.lua",
"actions/codelite/codelite_workspace.lua",
"actions/codelite/codelite_project.lua",
"actions/make/_make.lua",
"actions/codelite/_codelite.lua",
"actions/make/make_solution.lua",
"actions/make/make_cpp.lua",
"actions/make/make_csharp.lua",
"actions/make/_make.lua",
"actions/xcode/_xcode.lua",
"actions/vstudio/_vstudio.lua",
"actions/vstudio/vs2002_solution.lua",
"actions/vstudio/vs2002_csproj.lua",
"actions/vstudio/vs2002_csproj_user.lua",
@ -45,5 +44,6 @@
"actions/vstudio/vs2005_solution.lua",
"actions/vstudio/vs2005_csproj.lua",
"actions/vstudio/vs2005_csproj_user.lua",
"actions/vstudio/_vstudio.lua",
"actions/clean/_clean.lua",
}

View File

@ -177,11 +177,13 @@
--
local function output(indent, value)
io.write(indent .. value .. "\r\n")
-- io.write(indent .. value .. "\r\n")
_p(indent .. value)
end
local function attrib(indent, name, value)
io.write(indent .. "\t" .. name .. '="' .. value .. '"\r\n')
-- io.write(indent .. "\t" .. name .. '="' .. value .. '"\r\n')
_p(indent .. "\t" .. name .. '="' .. value .. '"')
end
function _VS.files(prj, fname, state, nestlevel)
@ -201,17 +203,20 @@
attrib(indent, "RelativePath", path.translate(fname, "\\"))
output(indent, "\t>")
if (not prj.flags.NoPCH and prj.pchsource == fname) then
for _, cfgname in ipairs(prj.configurations) do
for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
if cfginfo.isreal then
local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
output(indent, "\t<FileConfiguration")
attrib(indent, "\tName", cfgname .. "|Win32")
attrib(indent, "\tName", cfginfo.name)
output(indent, "\t\t>")
output(indent, "\t\t<Tool")
attrib(indent, "\t\tName", "VCCLCompilerTool")
attrib(indent, "\t\tName", iif(cfg.system == "Xbox360", "VCCLX360CompilerTool", "VCCLCompilerTool"))
attrib(indent, "\t\tUsePrecompiledHeader", "1")
output(indent, "\t\t/>")
output(indent, "\t</FileConfiguration>")
end
end
end
output(indent, "</File>")
end
end

View File

@ -438,3 +438,69 @@
/>
]]
end
--
-- Test precompiled header handling
--
function T.vs200x_vcproj.PCH_OnWindows()
files { "afxwin.cpp" }
pchsource "afxwin.cpp"
prepare()
_VS.files(prj, "afxwin.cpp", "Item", 1)
test.capture [[
<File
RelativePath="afxwin.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
]]
end
function T.vs200x_vcproj.PCH_OnXbox360()
files { "afxwin.cpp" }
pchsource "afxwin.cpp"
platforms { "Xbox360" }
prepare()
sln.vstudio_configs = premake.vstudio_buildconfigs(sln)
_VS.files(prj, "afxwin.cpp", "Item", 1)
test.capture [[
<File
RelativePath="afxwin.cpp"
>
<FileConfiguration
Name="Debug|Xbox 360"
>
<Tool
Name="VCCLX360CompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Xbox 360"
>
<Tool
Name="VCCLX360CompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
]]
end