Improve Xbox 360 support
This commit is contained in:
parent
99a80052da
commit
b10f1b5b60
@ -33,6 +33,7 @@
|
|||||||
* Added ExcludeFromBuild flag to mark source files as non-buildable
|
* Added ExcludeFromBuild flag to mark source files as non-buildable
|
||||||
* Added MultiProcessorCompile flag to run multiple compiler processes
|
* Added MultiProcessorCompile flag to run multiple compiler processes
|
||||||
* Fixed assembly references for Visual Studio Managed C++ projects
|
* Fixed assembly references for Visual Studio Managed C++ projects
|
||||||
|
* Improved Xbox 360 support
|
||||||
|
|
||||||
|
|
||||||
-------
|
-------
|
||||||
|
@ -40,9 +40,12 @@
|
|||||||
-- Windows and friends.
|
-- Windows and friends.
|
||||||
--
|
--
|
||||||
|
|
||||||
configuration { "Windows or Xbox360 or C#", "ConsoleApp or WindowedApp" }
|
configuration { "Windows or C#", "ConsoleApp or WindowedApp" }
|
||||||
targetextension ".exe"
|
targetextension ".exe"
|
||||||
|
|
||||||
|
configuration { "Xbox360", "ConsoleApp or WindowedApp" }
|
||||||
|
targetextension ".xex"
|
||||||
|
|
||||||
configuration { "Windows or Xbox360 or C#", "SharedLib" }
|
configuration { "Windows or Xbox360 or C#", "SharedLib" }
|
||||||
targetprefix ""
|
targetprefix ""
|
||||||
targetextension ".dll"
|
targetextension ".dll"
|
||||||
|
@ -51,6 +51,8 @@
|
|||||||
vc2010.resourceCompile(cfg)
|
vc2010.resourceCompile(cfg)
|
||||||
vc2010.link(cfg)
|
vc2010.link(cfg)
|
||||||
vc2010.buildEvents(cfg)
|
vc2010.buildEvents(cfg)
|
||||||
|
vc2010.imageXex(cfg)
|
||||||
|
vc2010.deploy(cfg)
|
||||||
_p(1,'</ItemDefinitionGroup>')
|
_p(1,'</ItemDefinitionGroup>')
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -189,6 +191,7 @@
|
|||||||
vc2010.intDir(cfg)
|
vc2010.intDir(cfg)
|
||||||
vc2010.targetName(cfg)
|
vc2010.targetName(cfg)
|
||||||
vc2010.targetExt(cfg)
|
vc2010.targetExt(cfg)
|
||||||
|
vc2010.imageXexOutput(cfg)
|
||||||
vc2010.generateManifest(cfg)
|
vc2010.generateManifest(cfg)
|
||||||
_p(1,'</PropertyGroup>')
|
_p(1,'</PropertyGroup>')
|
||||||
end
|
end
|
||||||
@ -233,11 +236,13 @@
|
|||||||
--
|
--
|
||||||
|
|
||||||
function vc2010.resourceCompile(cfg)
|
function vc2010.resourceCompile(cfg)
|
||||||
|
if cfg.system ~= premake.XBOX360 then
|
||||||
_p(2,'<ResourceCompile>')
|
_p(2,'<ResourceCompile>')
|
||||||
vc2010.preprocessorDefinitions(table.join(cfg.defines, cfg.resdefines))
|
vc2010.preprocessorDefinitions(table.join(cfg.defines, cfg.resdefines))
|
||||||
vc2010.additionalIncludeDirectories(cfg, table.join(cfg.includedirs, cfg.resincludedirs))
|
vc2010.additionalIncludeDirectories(cfg, table.join(cfg.includedirs, cfg.resincludedirs))
|
||||||
_p(2,'</ResourceCompile>')
|
_p(2,'</ResourceCompile>')
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -499,9 +504,11 @@
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
--
|
--
|
||||||
-- Handlers for individual project elements.
|
-- Handlers for individual project elements
|
||||||
--
|
--
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
function vc2010.additionalDependencies(cfg, explicit)
|
function vc2010.additionalDependencies(cfg, explicit)
|
||||||
local links
|
local links
|
||||||
@ -609,6 +616,17 @@
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function vc2010.deploy(cfg)
|
||||||
|
if cfg.system == premake.XBOX360 then
|
||||||
|
_p(2,'<Deploy>')
|
||||||
|
_p(3,'<DeploymentType>CopyToHardDrive</DeploymentType>')
|
||||||
|
_p(3,'<DvdEmulationType>ZeroSeekTimes</DvdEmulationType>')
|
||||||
|
_p(3,'<DeploymentFiles>$(RemoteRoot)=$(ImagePath);</DeploymentFiles>')
|
||||||
|
_p(2,'</Deploy>')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function vc2010.enableEnhancedInstructionSet(cfg)
|
function vc2010.enableEnhancedInstructionSet(cfg)
|
||||||
if cfg.flags.EnableSSE2 then
|
if cfg.flags.EnableSSE2 then
|
||||||
_p(3,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>')
|
_p(3,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>')
|
||||||
@ -619,7 +637,11 @@
|
|||||||
|
|
||||||
|
|
||||||
function vc2010.entryPointSymbol(cfg)
|
function vc2010.entryPointSymbol(cfg)
|
||||||
if vc2010.configType(cfg) == "Application" and not cfg.flags.WinMain and not cfg.flags.Managed then
|
if vc2010.configType(cfg) == "Application" and
|
||||||
|
not cfg.flags.WinMain and
|
||||||
|
not cfg.flags.Managed and
|
||||||
|
cfg.system ~= premake.XBOX360
|
||||||
|
then
|
||||||
_p(3,'<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>')
|
_p(3,'<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -681,6 +703,25 @@
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function vc2010.imageXex(cfg)
|
||||||
|
if cfg.system == premake.XBOX360 then
|
||||||
|
_p(2,'<ImageXex>')
|
||||||
|
_p(3,'<ConfigurationFile>')
|
||||||
|
_p(3,'</ConfigurationFile>')
|
||||||
|
_p(3,'<AdditionalSections>')
|
||||||
|
_p(3,'</AdditionalSections>')
|
||||||
|
_p(2,'</ImageXex>')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function vc2010.imageXexOutput(cfg)
|
||||||
|
if cfg.system == premake.XBOX360 then
|
||||||
|
_x(2,'<ImageXexOutput>$(OutDir)$(TargetName).xex</ImageXexOutput>')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function vc2010.import(prj)
|
function vc2010.import(prj)
|
||||||
_p(1,'<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.targets" />')
|
_p(1,'<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.targets" />')
|
||||||
_p(1,'<ImportGroup Label="ExtensionTargets">')
|
_p(1,'<ImportGroup Label="ExtensionTargets">')
|
||||||
@ -870,9 +911,11 @@
|
|||||||
|
|
||||||
|
|
||||||
function vc2010.subSystem(cfg)
|
function vc2010.subSystem(cfg)
|
||||||
|
if cfg.system ~= premake.XBOX360 then
|
||||||
local subsystem = iif(cfg.kind == premake.CONSOLEAPP, "Console", "Windows")
|
local subsystem = iif(cfg.kind == premake.CONSOLEAPP, "Console", "Windows")
|
||||||
_p(3,'<SubSystem>%s</SubSystem>', subsystem)
|
_p(3,'<SubSystem>%s</SubSystem>', subsystem)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function vc2010.targetExt(cfg)
|
function vc2010.targetExt(cfg)
|
||||||
|
@ -359,3 +359,20 @@
|
|||||||
<AdditionalDependencies>kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Xbox 360 doesn't list a subsystem or entry point.
|
||||||
|
--
|
||||||
|
|
||||||
|
function suite.onXbox360()
|
||||||
|
kind "ConsoleApp"
|
||||||
|
system "Xbox360"
|
||||||
|
prepare()
|
||||||
|
test.capture [[
|
||||||
|
<Link>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
@ -57,10 +57,11 @@
|
|||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
<OutDir>.\</OutDir>
|
<OutDir>.\</OutDir>
|
||||||
<OutputFile>$(OutDir)MyProject.exe</OutputFile>
|
<OutputFile>$(OutDir)MyProject.xex</OutputFile>
|
||||||
<IntDir>obj\Debug\</IntDir>
|
<IntDir>obj\Debug\</IntDir>
|
||||||
<TargetName>MyProject</TargetName>
|
<TargetName>MyProject</TargetName>
|
||||||
<TargetExt>.exe</TargetExt>
|
<TargetExt>.xex</TargetExt>
|
||||||
|
<ImageXexOutput>$(OutDir)$(TargetName).xex</ImageXexOutput>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
--
|
--
|
||||||
-- tests/actions/vstudio/vc2010/test_resource_compile.lua
|
-- tests/actions/vstudio/vc2010/test_resource_compile.lua
|
||||||
-- Validate resource compiler settings in Visual Studio 2010 C/C++ projects.
|
-- Validate resource compiler settings in Visual Studio 2010 C/C++ projects.
|
||||||
-- Copyright (c) 2011-2012 Jason Perkins and the Premake project
|
-- Copyright (c) 2011-2013 Jason Perkins and the Premake project
|
||||||
--
|
--
|
||||||
|
|
||||||
T.vstudio_vs2010_resource_compiler = { }
|
local suite = test.declare("vs2010_resource_compiler")
|
||||||
local suite = T.vstudio_vs2010_resource_compiler
|
|
||||||
local vc2010 = premake.vstudio.vc2010
|
local vc2010 = premake.vstudio.vc2010
|
||||||
local project = premake5.project
|
local project = premake5.project
|
||||||
|
|
||||||
@ -20,8 +19,8 @@
|
|||||||
sln, prj = test.createsolution()
|
sln, prj = test.createsolution()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function prepare(platform)
|
local function prepare()
|
||||||
cfg = project.getconfig(prj, "Debug", platform)
|
cfg = project.getconfig(prj, "Debug")
|
||||||
vc2010.resourceCompile(cfg)
|
vc2010.resourceCompile(cfg)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -66,3 +65,14 @@
|
|||||||
<AdditionalIncludeDirectories>include\lua;include\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>include\lua;include\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Xbox 360 doesn't use the resource compiler.
|
||||||
|
--
|
||||||
|
|
||||||
|
function suite.skips_onXbox360()
|
||||||
|
system "Xbox360"
|
||||||
|
prepare()
|
||||||
|
test.isemptycapture()
|
||||||
|
end
|
||||||
|
@ -220,14 +220,14 @@
|
|||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name should use ".exe" for Xbox360 executables.
|
-- Name should use ".xex" for Xbox360 executables.
|
||||||
--
|
--
|
||||||
|
|
||||||
function suite.nameUsesExe_onWindowsConsoleApp()
|
function suite.nameUsesExe_onWindowsConsoleApp()
|
||||||
kind "ConsoleApp"
|
kind "ConsoleApp"
|
||||||
system "Xbox360"
|
system "Xbox360"
|
||||||
i = prepare()
|
i = prepare()
|
||||||
test.isequal("MyProject.exe", i.name)
|
test.isequal("MyProject.xex", i.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user