########################################################################################################################## # RULES FILE # Usage & Details : https://devstar.rockstargames.com/wiki/index.php/Dev:Project_builder3#game.rules ########################################################################################################################## # Rules : independent of exporter. Rules { #------------------------------------------------------------------------------------------- # Setup Scratch ( make your own vars here and reuse with syntax. ) #------------------------------------------------------------------------------------------- Scratch.BuildDir = '$(RS_TITLE_UPDATE)' Scratch.CompressMap = '"$(RS_TOOLSROOT)\bin\coding\compressmap"' Scratch.CompressMap64 = '"$(RS_TOOLSROOT)\bin\coding\compressmap_x64"' Scratch.Ps3Bin = '$(SCE_PS3_ROOT)\host-win32\sn\bin\ps3bin' Scratch.DumpBin = '$(RS_TOOLSROOT)\script\util\dumpbin.rb' Scratch.StripObjects = '$(RS_TOOLSROOT)/bin/coding/python/stripobjects.exe' Scratch.XbeCopy = '"$(XEDK)\bin\win32\xbecopy"' Scratch.Xbox[Platform=='Durango'||Platform=='Gaming.Xbox.XboxOne.x64'||Platform=='Gaming.Xbox.Scarlett.x64'] = 'true' Scratch.SCE[Platform=='Prospero'||Platform=='Orbis'] = 'true' Scratch.Objects = '$(RS_CODEBRANCH)/objects' Scratch.Intermediate = '/$(MSBuildProjectName)/$(PlatformName)_$(Configuration)/$(PlatformToolset)' # 'Architecture' Scratch.Arch[Platform=='PS3'] = 'psn' Scratch.Arch[Platform=='Xbox 360'] = 'xenon' Scratch.Arch[Platform=='Win32'] = 'win32' Scratch.Arch[Platform=='x64'] = 'win64' Scratch.Arch[Platform=='Orbis'] = 'orbis' Scratch.Arch[Platform=='Durango'] = 'durango' # DX11 name mangling : pain in the t*ts Scratch.ForceInclude = '_.h' Scratch.ForceInclude[Config=='Debug DX11'] = '_dx11_debug.h' Scratch.ForceInclude[Config=='Beta DX11'] = '_dx11_beta.h' Scratch.ForceInclude[Config=='BankRelease DX11']= '_dx11_bankrelease.h' Scratch.ForceInclude[Config=='Release DX11'] = '_dx11_release.h' Scratch.ForceInclude[Config=='Profile DX11'] = '_dx11_profile.h' Scratch.ForceInclude[Config=='Final DX11'] = '_dx11_final.h' # force includes for master configs Scratch.ForceInclude[Config=~'Master'] = '_master.h' # force include for steam Scratch.ForceInclude[Config=='SteamBeta'] = '_beta.h' Scratch.ForceInclude[Config=='SteamRelease']= '_release.h' Scratch.ForceInclude[Config=='SteamFinal'] = '_final.h' Scratch.ForceInclude[Config=='SteamMaster'] = '_master.h' # force include for Social Club DLL Scratch.ForceInclude[Config=='RgscDebug'] = '_debug.h' Scratch.ForceInclude[Config=='RgscRelease'] = '_final.h' #------------------------------------------------------------------------------------------- # General #------------------------------------------------------------------------------------------- Settings.General.Rtti = 'true' Settings.General.IsolateConfigurationsOnDeploy = 'true' Condition [Platform=='Win32'] { Settings.General.IncludePath += '$(WindowsSdk_Dir)\Include\shared' Settings.General.IncludePath += '$(WindowsSdk_Dir)\Include\um' Settings.General.IncludePath += '$(DXSDK_DIR)\Include' Settings.General.LibraryPath += '$(WindowsSdk_Dir)\lib\win8\um\x86' Settings.General.LibraryPath += '$(DXSDK_DIR)\Lib\x86' } Condition [Platform=='x64'] { Settings.General.IncludePath += '$(WindowsSdk_Dir)\Include\shared' Settings.General.IncludePath += '$(WindowsSdk_Dir)\Include\um' Settings.General.IncludePath += '$(DXSDK_DIR)\Include' Settings.General.LibraryPath += '$(WindowsSdk_Dir)\lib\win8\um\x64' Settings.General.LibraryPath += '$(DXSDK_DIR)\Lib\x64' } Condition [Platform=='Durango'] { Settings.General.IncludePath += '$(DurangoXDK)/xdk/include/winrt' Settings.General.IncludePath += '$(DurangoXDK)/xdk/include/um' Settings.General.IncludePath += '$(DurangoXDK)/xdk/include/shared' Settings.General.LibraryPath += '$(RAGE_DIR)/lib' Settings.General.LibraryPath += '$(DurangoXDK)/xdk/lib' } # # Note the suffix for the exporter eg. _vs_2010 is not set here, this is responsibility of the exporter rules # Action Settings.General.OutputDirectoryName { # These files are never checked in, so things that aren't an exe can be considered intermediate [ProjectType!='Exe'] = '/' [ProjectType=='Exe'&&Scratch.Xbox!='true'] = '/' # exe written directly to build directory. # Durango cannot write directly to the build directory. The Durango build will automatically copy the contents of the $(OutDir) to the loose # folder (in this case all of the data) to be sent to the console itself. [ProjectType=='Exe'&&Scratch.Xbox=='true'] = '/Build/' } # NOTE: there ARE exporter rules that augment this setting further ( if the case of unity ) Action Settings.General.IntermediateDirectoryName { # Do not pollute the output folder with intermediate files. [ProjectType=='Exe'] = '/' [ProjectType!='Exe'] = '/' } # NOTE: there ARE exporter rules that augment this setting further ( if unity ) Action Settings.General.TargetName { = '$(ProjectName)' # All targets start out with a name. [ProjectType=='Exe'] << '__' # for EXE though we mangle with its architecture, since it will reside alongside other 'exes', for everything else a name is good enough. [ProjectType=='Exe'&&Platform=='PS3'] << '_snc' # PS3 quirk - is this necessary? } #------------------------------------------------------------------------------------------- # Compiler #------------------------------------------------------------------------------------------- Action Settings.Compiler.FavourSize { [Name=='Beta|Xbox 360'||Name=='BankRelease|Durango'||Name=='Release|Durango'||Name=='Final|Durango'||Name=='Master|Durango'] = 'true' [Name!='Beta|Xbox 360'&&Name!='BankRelease|Durango'&&Name!='Release|Durango'&&Name!='Final|Durango'&&Name!='Master|Durango'] = 'false' } Action Settings.Compiler.FavourSpeed { [Name=='Beta|Xbox 360'||Name=='BankRelease|Durango'||Name=='Release|Durango'||Name=='Final|Durango'||Name=='Master|Durango'] = 'false' [Name!='Beta|Xbox 360'&&Name!='BankRelease|Durango'&&Name!='Release|Durango'&&Name!='Final|Durango'&&Name!='Master|Durango'] = 'true' } Settings.Compiler.GenerateDebugInformation = 'true' Settings.Compiler.TreatWarningsAsErrors = 'true' Action Settings.Compiler.StringPooling { [ProjectType!='Exe'] = 'true' [ProjectType=='Exe'] = 'false' [Name=='ToolBeta|Win32'] = 'false' } Action Settings.Compiler.AdditionalOptions { [Name=='Profile|Xbox 360'||Name=='Release|Xbox 360'||Name=='BankRelease|Xbox 360'||Name=='Final|Xbox 360'] += '/QVMX128' [Name=='Master|Xbox 360'] += '/QVMX128' [Name=='Profile|Xbox 360'] += '/callcap' [Platform=='Orbis'] += '-frtti' [Platform=='Durango'] += '/D "__RAGE_STD_EXCEPTIONS"' # Needed to enable exception handling in STLPort } Action Settings.Compiler.PreprocessorDefinitions { [ProjectType!='Exe'] += '_LIB' [ProjectType=='Exe'] += '_WINDOWS' # some settings are as I found them in the old project generator, I suspect such exe / lib variations might not actually have been intentional ( somebody please review ) [Platform=='Xbox 360'||Platform=='Win32'] += 'WIN32' [Platform=='x64'||Scratch.Xbox=='true'] += 'WIN64' [Platform=='PS3'] += '__SNC__' [Platform=='PS3'] += 'SN_TARGET_PS3' [Platform=='x64'||Platform=='Win32'] += '__DXSDK=$(DXSDK_DIR)' [Config=='SteamBeta'||Config=='SteamRelease'||Config=='SteamFinal'||Config=='SteamMaster'] += '__STEAM_BUILD=1' [Config=='RgscDebug'||Config=='RgscRelease'] += '__RGSC_DLL=1' [Config=~'Debug'||Config=='Beta DX11'||Config=='RscBeta'||Config=='ToolBeta'] += '_DEBUG' [Config=='Beta'||Config=~'Release'||Config=~'Final'||Config=~'Profile'||Config=~'Master'] += 'NDEBUG' } Action Settings.Compiler.ForceIncludes { +='$(RAGE_DIR)\base\src\forceinclude\' } Action Settings.Compiler.AdditionalIncludeDirectories { +='$(RAGE_DIR)\base\src' +='$(RAGE_DIR)\suite\src' +='$(ProjectDir)..' +='$(RAGE_DIR)\naturalmotion\include' +='$(RAGE_DIR)\naturalmotion\src' +='$(RAGE_DIR)\script\src' +='$(RAGE_DIR)\framework\src' [Config=='RscDebug'||Config=='RscBeta'||Config =='RscRelease'] += '$(DurangoXDK)\pc\include' [Config=='RgscDebug'||Config=='RgscRelease'] += '$(RAGE_DIR)\suite\src\rgsc\rgsc\rgsc\public_interface;' } Action Settings.Compiler.AdditionalLibraryDirectories { [Platform=='Durango'] += '$(RAGE_DIR)\lib' } #------------------------------------------------------------------------------------------- # Librarian #------------------------------------------------------------------------------------------- Condition [ProjectType!='Exe'] { Settings.Librarian.AdditionalOptions[Platform!='PS3' && Platform!='Orbis'] += '/ignore:4221' } #------------------------------------------------------------------------------------------- # Exe Settings : Linker, Image & Deploy #------------------------------------------------------------------------------------------- Condition [ProjectType=='Exe'] { Settings.Linker.AdditionalLibraryDirectories += '$(RAGE_DIR)\lib' Settings.Linker.AdditionalOptions[Platform!='PS3' && Platform!='Orbis'] += '/FIXED:NO' Settings.Linker.AdditionalOptions[Platform!='PS3' && Platform!='Orbis'] += '/IGNORE:4089' Settings.Linker.GenerateDebugInfo = 'true' Settings.Linker.GenerateMapFile = 'true' Settings.Linker.LinkIncremental = 'false' Settings.Linker.LinkIncremental[Config=='Debug'] = 'true' # not sure what this was set in previous project generator - verify this is what you want. Settings.Xbox.LayoutDir[Scratch.Xbox=='true'] = '\Layout\$(MSBuildProjectName)\$(Platform)' Settings.Xbox.LayoutExtensionFilter[Scratch.Xbox=='true'] = '*.pdb;*.ipdb;*.iobj;*.obj;*.pch;*.ilk;*.exp;*.lib;*.winmd;*.appxrecipe;*.log;*.tlog;*unsuccessfulbuild;*.lastbuildstate;*.copycomplete' } Condition [ProjectType=='Exe' && Config=='Debug'] { Settings.Linker.AdditionalOptions[Platform=='x64' || Platform=='Win32'] += '/NODEFAULTLIB:LIBCMT' } Condition [ProjectType=='Exe'&&Platform=='Orbis'] { Settings.Linker.AdditionalLibraryDirectories += '$(SCE_ORBIS_SDK_DIR)\target\lib;' } Condition [ProjectType=='Exe'&&Platform=='PS3'] { Settings.Linker.DataStripping = 'StripFuncsAndData' Settings.Linker.AdditionalLibraryDirectories += '"$(SCE_PS3_ROOT)\target\ppu\lib"' Settings.Linker.AdditionalOptions += '--notocrestore' Settings.Linker.AdditionalOptions += '-Wl,--disable-warning=134' Settings.Linker.AdditionalOptions += '-Wl,--oformat=fself' Settings.Linker.AdditionalOptions[Config=='Final'] += '-Wl,--write-fself-digest -Wl,--ppuguid' Settings.Linker.AdditionalOptions[Config=~'Master'] += '-Wl,--write-fself-digest -Wl,--ppuguid' Settings.Linker.AdditionalOptions += '-Wl,--strip-duplicates' Settings.Linker.AdditionalOptions[Config=='Profile'] += '--callprof' } Condition [ProjectType=='Exe'&&Platform=='Xbox 360'] { Settings.Linker.AdditionalDependencies += 'xboxkrnl.lib' Settings.Linker.IgnoreLibraries[Config!='Release' && Config!='Final'] += 'xapilib.lib' #------------------------------------------------------------------------------------------- # Image #------------------------------------------------------------------------------------------- Settings.Image.OutputFilename = '/$(ProjectName)__.xex' #------------------------------------------------------------------------------------------- # Deploy #------------------------------------------------------------------------------------------- Settings.Deploy.DeployFiles += '$(RemoteRoot)=$(TEMP)\rfs.dat' Settings.Deploy.DeployFiles += '$(RemoteRoot)=$(ImagePath)' Settings.Deploy.DeployType = 'CopyToHardDrive' Settings.Deploy.ExecutionBucket = '85313600' Settings.Deploy.RemoteRoot = 'xe:\$(ProjectName)' } Condition [ProjectType=='Exe' && Platform=='x64' && Config=~'Master'] { Settings.Linker.SubSystem = 'Windows' Settings.Linker.EntryPointSymbol = 'mainCRTStartup' } #------------------------------------------------------------------------------------------- # Add WinRT support for Durango Files. #------------------------------------------------------------------------------------------- Condition [Platform=='Durango'] { Settings.Compiler.AdditionalUsingDirectories +='$(Console_SdkRoot)xdk\Extensions\Xbox Services API\8.0\References\CommonConfiguration\neutral' Settings.Compiler.AdditionalUsingDirectories +='$(Console_SdkRoot)xdk\Extensions\Xbox GameChat API\8.0\References\CommonConfiguration\neutral' Settings.Compiler.AdditionalUsingDirectories +='$(Console_SdkIncludeRoot)' Settings.Compiler.AdditionalUsingDirectories +='$(Console_SdkWindowsMetadataPath)' Settings.Compiler.AdditionalUsingDirectories +='$(Console_SdkLibPath)' Settings.Compiler.ForcedUsingFiles +='platform.winmd' Settings.Compiler.ForcedUsingFiles +='windows.winmd' Settings.Linker.AdditionalLibraryDirectories += '$(Console_SdkLibPath)' } Condition [ProjectType!='Exe'&&Platform=='Durango'] { # Setting this on the Exe project causes some issues referencing its dll. Settings.Compiler.ForcedUsingFiles +='microsoft.xbox.services.winmd' Settings.Compiler.ForcedUsingFiles +='microsoft.xbox.gamechat.winmd' } Condition [ProjectType=='Exe'&&Platform=='Durango'] { # These were taken from the original Durango specific porject. I don't know which ones are needed (but some are) so I added all of them. Settings.Linker.IgnoreSpecificDefaultLibraries = '$(IgnoreSpecificDefaultLibraries);' Settings.Linker.IgnoreSpecificDefaultLibraries += 'advapi32.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'atl.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'atls.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'atlsd.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'atlsn.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'atlsnd.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'comctl32.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'comsupp.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'dbghelp.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'gdi32.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'gdiplus.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'guardcfw.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'kernel32.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'mmc.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'msimg32.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'msvcole.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'msvcoled.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'mswsock.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'ntstrsafe.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'ole2.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'ole2autd.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'ole2auto.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'ole2d.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'ole2ui.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'ole2uid.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'ole32.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'oleacc.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'oleaut32.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'oledlg.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'oledlgd.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'oldnames.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'runtimeobject.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'shell32.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'shlwapi.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'strsafe.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'urlmon.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'user32.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'userenv.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'uuid.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'wlmole.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'wlmoled.lib;' Settings.Linker.IgnoreSpecificDefaultLibraries += 'ws2_32.lib;' # Using the default value here %(AdditionalDependencies) fails on durango. For further info see # https://forums.xboxlive.com/AnswerPage.aspx?qid=f9393f83-5d97-46ef-95cf-78df175ab1f8&tgt=1 Settings.Linker.AdditionalDependencies = 'combase.lib;' Settings.Linker.AdditionalDependencies += 'kernelx.lib;' Settings.Linker.AdditionalDependencies += 'uuid.lib;' Settings.Linker.AdditionalDependencies += 'xaudio2.lib;' Settings.Linker.AdditionalDependencies += 'ws2_32.lib;' Settings.Linker.AdditionalDependencies += 'dxguid.lib;' Settings.Linker.AdditionalDependencies += 'EtwPlus.lib;' # This was set to Windows in the original Durango project and final does not work without it. Settings.Linker.SubSystem = 'Windows' } # # Override some settings at the file level for Durango # this is limited to one pattern per target # you may make that match multiple files but the settings will be the same. # Condition [Platform=='Durango'] { # # Match the filenames here for which we wish to override settings on a per file basis. By default these are anything ending with .winrt.cpp, # or in a durango subdirectory. We have to specify the unity files directly. # Settings.Compiler.FilenamePatternOverride = '.*\.winrt\.cpp|.*\\durango\\.*\.cpp|.*Core\\main\.cpp' # # Override is limited to these settings only. # Settings.Compiler.FileOverride_AdditionalIncludeDirectories ='$(RAGE_DIR)\base\src' Settings.Compiler.FileOverride_AdditionalIncludeDirectories +='$(RAGE_DIR)\suite\src' Settings.Compiler.FileOverride_AdditionalIncludeDirectories +='$(ProjectDir)..' Settings.Compiler.FileOverride_AdditionalIncludeDirectories +='$(RAGE_DIR)\naturalmotion\include' Settings.Compiler.FileOverride_AdditionalIncludeDirectories +='$(RAGE_DIR)\naturalmotion\src' Settings.Compiler.FileOverride_AdditionalIncludeDirectories +='$(RAGE_DIR)\script\src' Settings.Compiler.FileOverride_AdditionalIncludeDirectories +='$(RAGE_DIR)\framework\src' Settings.Compiler.FileOverride_CompileAsWinRt = 'true' Settings.Compiler.FileOverride_ExceptionHandling = 'Sync' } } # end rules # Exporter Rules must always be run after normal rules. # Residing here are rules that are exporter conditional. # Also we have 'bucket' rules that are yet to be abstracted into an independent format. ExporterRules[Exporter=~'VS201'] { # The family of VS201X exporters ( VCXPROJ ) #------------------------------------------------------------------------------------------- # Scratch ( ExporterRules ) #------------------------------------------------------------------------------------------- Scratch.Unity[Exporter=~'_Unity'] = '_unity' Scratch.Unity[Exporter!~'_Unity'] = '' Scratch.VS[Exporter=~'VS2010'] = '2010' Scratch.VS[Exporter=~'VS2012'] = '2012' #------------------------------------------------------------------------------------------- # Deactivate specific targets at export if required #------------------------------------------------------------------------------------------- Condition [Exporter=~'VS2010'] { Active[Platform=='Durango'] = 'false' } Condition [Exporter=~'VS2012'] { Active[Platform=='Xbox 360'] = 'false' } #------------------------------------------------------------------------------------------- # General ( ExporterRules ) #------------------------------------------------------------------------------------------- Settings.General.CharacterSet = 'MultiByte' Settings.General.WholeProgramOptimization[Name=='Master|Durango'] = 'true' # no current need to append anything to the out/int directories at the moment # Settings.General.OutputDirectoryName[ProjectType!='Exe'] << '_/' # for libs the output directory needs to be unique for unity and exporter variants # Settings.General.IntermediateDirectoryName[ProjectType=='Exe'] << '_/' # for exe only the intermediate directory only is required to be elsewhere, don't worry libs will use $(OutDir) - this uses the above. Settings.General.PlatformToolset[Exporter=~'VS2012'&&Platform=='Win32'] = 'v110_xp' Settings.General.PlatformToolset[Exporter=~'VS2012'&&Platform=='Win32'] = 'v110_xp' Settings.General.PlatformToolset[Exporter=~'VS2012'&&Platform=='Win32'&&Config=='RgscDebug'] = 'v110_xp' Settings.General.PlatformToolset[Exporter=~'VS2012'&&Platform=='Win32'&&Config=='RgscRelease'] = 'v110_xp' Settings.General.PlatformToolset[Exporter=~'VS2012'&&Platform=='x64'&&Config=='RgscDebug'] = 'v110_xp' Settings.General.PlatformToolset[Exporter=~'VS2012'&&Platform=='x64'&&Config=='RgscRelease'] = 'v110_xp' Settings.General.SDKReference[Exporter=~'VS2012'&&Platform=='Durango'&&ProjectType=='Exe'] += 'Xbox Services API, Version=8.0' Settings.General.SDKReference[Exporter=~'VS2012'&&Platform=='Durango'&&ProjectType=='Exe'] += 'Xbox GameChat API, Version=8.0' Action Settings.General.Exceptions { # False, Sync, SyncCThrow, Async = 'False' #[Name=='ToolDebug|Win32'] = 'Sync' } #------------------------------------------------------------------------------------------- # Compiler ( ExporterRules ) #------------------------------------------------------------------------------------------- Settings.Compiler.CompileAsWinRT[Platform=='Durango'] = 'false' Action Settings.Compiler.FunctionLevelLink { [ProjectType=='Exe'] = 'false' # some settings are as I found them in the old project generator, I suspect such exe / lib variations might not actually have been intentional ( somebody please review ) [ProjectType!='Exe'] = 'true' } Settings.Compiler.PreprocessorDefinitions += '$(RS_PREPROCESSOR)' Settings.Compiler.PreprocessorDefinitions[Environment.RS_BRANCHNAME=~'ng'] += 'RSG_GEN9=0' Settings.Compiler.PreprocessorDefinitions[Environment.RS_BRANCHNAME=~'gen9'] += 'RSG_GEN9=1' # Disabled, Full, MaxSpeed, MinSpace Action Settings.Compiler.Optimization { [Platform!='PS3'] = 'MaxSpeed' [Config=~'Debug'&&Platform!='PS3'] = 'Disabled' [Config=='Release'&&Platform!='PS3'] = 'Full' [Config=='BankRelease'&&Platform!='PS3'] = 'Full' [Config=='Profile'&&Platform!='PS3'] = 'Full' [Config=='Final'&&Platform!='PS3'] = 'Full' [Config=~'Master'&&Platform!='PS3'] = 'Full' [Name=='ToolDebug|Win32'] = 'Disabled' [Name=='Beta|Xbox 360'] = 'MinSpace' } Action Settings.Compiler.RunTimeLibrary { # MultiThreaded, MultiThreadedDebugDLL, MultiThreadedDebug, MultiThreadedDLL = 'MultiThreaded' [Config=~'Debug'&&Platform!='PS3'] = 'MultiThreadedDebug' [Config=='ToolDebug'] = 'MultiThreadedDebugDLL' [Config=='ToolBeta'||Config=='ToolRelease'] = 'MultiThreadedDLL' [Config=='Debug'&&Platform=='Durango'] = 'MultiThreadedDebugDLL' [Config!='Debug'&&Platform=='Durango'] = 'MultiThreadedDLL' } Action Settings.Compiler.InlineFunctionExpansion { # Disabled, AnySuitable, OnlyExplicitInline = 'OnlyExplicitInline' [ProjectType!='Exe'&&Platform=='Xbox 360'] = 'AnySuitable' [Name=~'Master'&&Platform=='Durango'] = 'AnySuitable' [Name=~'Master'&&Platform=='x64'] = 'AnySuitable' [Name=='BankRelease|Durango'||Name=='Release|Durango'||Name=='Final|Durango'||Name=='Profile|Durango'||Name=='BankRelease|x64'||Name=='Release|x64'||Name=='Final|x64'||Name=='Profile|x64'] = 'AnySuitable' [Name=='ToolDebug|Win32'] = 'Default' # not compatible with DebugInformationFormat=EditAndContinue } Action Settings.Compiler.DisableSpecificWarnings { [Platform=='Win32'] += '4100' # eg. warning C4100: 'hasFocus' : unreferenced formal parameter [Platform=='PS3'] += '552' [Platform=='PS3'] += '178' } Settings.Compiler.BasicRuntimeChecks = 'default' Settings.Compiler.BasicRuntimeChecks[Name=='ToolDebug|Win32'] = 'EnableFastChecks' Settings.Compiler.BufferSecurityCheck = 'false' Settings.Compiler.BufferSecurityCheck[Name=='ToolBeta|Win32'||Name=='Final|Durango'||Name=='Master|Durango'] = 'true' Settings.Compiler.CompileAs = 'default' Settings.Compiler.DebugInformationFormat = 'ProgramDatabase' #Settings.Compiler.DebugInformationFormat[Config='ToolDebug'&&Platform=='Win32'] = 'EditAndContinue' Settings.Compiler.ForceConformanceInForLoopScope = 'true' Settings.Compiler.IntrinsicFunctions[ProjectType!='Exe'] = 'true' # some settings are as I found them in the old project generator, I suspect such exe / lib variations might not actually have been intentional ( somebody please review ) Settings.Compiler.IntrinsicFunctions[ProjectType=='Exe'] = 'false' Settings.Compiler.MinimalRebuild[Name=='ToolDebug|Win32'] = 'true' Settings.Compiler.OmitFramePointers[Name=='ToolBeta|Win32'] = 'false' Settings.Compiler.OptimizationLevel[Platform=='PS3'] = 'Levels' Settings.Compiler.OptimizationLevel[Name=='Debug|PS3'] = 'Leveld' # note name here OptimizationLevel NOT Optimization Settings.Compiler.OptimizationLevel[Platform=='ORBIS'] = 'Level3' # note name here OptimizationLevel NOT Optimization Settings.Compiler.OptimizationLevel[Name=='Beta|ORBIS'] = 'Level2' # note name here OptimizationLevel NOT Optimization Settings.Compiler.OptimizationLevel[Name=='Debug|ORBIS'] = 'Level0' # note name here OptimizationLevel NOT Optimization Settings.Compiler.PrecompiledHeader = 'NotUsing' Settings.Compiler.PrecompiledHeaderFile = '' Settings.Compiler.ProgramDataBaseFileName = '$(IntDir)$(TargetName).pdb' Settings.Compiler.TrapIntegerDividesOptimization[ProjectType!='Exe'&&Platform=='Xbox 360'] = 'true' # some settings are as I found them in the old project generator, I suspect such exe / lib variations might not actually have been intentional ( somebody please review ) Settings.Compiler.TrapIntegerDividesOptimization[ProjectType=='Exe'&&Platform=='Xbox 360'] = 'false' Settings.Compiler.FunctionLevelLink[ProjectType=='Exe'&&Config=='Debug'] = 'true' # copied from VS2008 settings - is this what is desired? Settings.Compiler.FunctionLevelLink[ProjectType!='Exe'&&Config!='Debug'] = 'true' Settings.Compiler.WarningLevel = 'Level4' # Off, Level1, Level2, Level3, Level4 Settings.Compiler.OpenMPSupport [Platform=='Win32'||Platform=='x64'] = 'true' Settings.Compiler.ExceptionHandling [Platform=='Durango'] = 'sync' # Overrides for everything except debug win32 builds. Condition [Config!='Debug'&&Config!='Debug DX11'&&Config!='RscDebug'&&Config!='ToolDebug'&&Platform!='ORBIS'&&Platform!='Xbox 360'&&Platform!='PS3'&&Platform!='Durango'] { Settings.Compiler.OmitFramePointers = 'true' Settings.Compiler.EnableFiberSafeOptimizations = 'true' Settings.Compiler.FloatingPointModel = 'Fast' Settings.Compiler.IntrinsicFunctions = 'true' Settings.Compiler.Optimization = 'Full' Settings.Compiler.FavourSpeed = 'false' Settings.Compiler.FavourSize = 'true' } Condition [Config=='ToolRelease'] { Settings.Compiler.Optimization = 'MaxSpeed' Settings.Compiler.FavourSpeed = 'true' Settings.Compiler.FavourSize = 'false' } Condition [Platform=='Win32'] { Settings.Compiler.EnableEnhancedInstructionSet = 'StreamingSIMDExtensions2' } Settings.Compiler.EnableEnhancedInstructionSet[Platform=='Durango'] = 'AdvancedVectorExtensions' #------------------------------------------------------------------------------------------- # Librarian ( ExporterRules ) #------------------------------------------------------------------------------------------- Settings.Librarian.ModuleDefinitionFile[Platform=='PS3'&&ProjectType!='Exe'] = '3' Condition [ProjectType=='Exe'] { Settings.Linker.MapFilename = '$(TargetDir)$(TargetName).map' Settings.Linker.OutputFilename = '$(TargetPath)' Settings.Linker.EnableCOMDATFolding = 'true' Settings.Linker.OptimizeReferences = 'true' Settings.Linker.LargeAddressAware[Platform=='Win32'] = 'true' } #------------------------------------------------------------------------------------------- # Build Events ( ExporterRules ) #------------------------------------------------------------------------------------------- Condition [ProjectType=='Exe'] { Settings.BuildEvents.PreLink.Description = 'Delete Compressed Map.' Settings.BuildEvents.PreLink.Command << 'del "$(TargetDir)$(TargetName).cmp"' } Condition [ProjectType=='Exe'&&Platform=='PS3'] { Settings.BuildEvents.PostBuild.Description = 'Create Symbol table, compress.' Settings.BuildEvents.PostBuild.Command << ' -dsy -c "$(TargetPath)" > "$(TargetDir)$(TargetName).sym" &&' Settings.BuildEvents.PostBuild.Command << ' "$(TargetDir)$(TargetName).sym"' } Condition [ProjectType=='Exe'&&Platform=='Orbis'] { Settings.BuildEvents.PostBuild.Description = 'Compress map.' Settings.BuildEvents.PostBuild.Command << '$(RS_TOOLSROOT)\bin\coding\compressmap_x64 "$(TargetDir)$(TargetName).map" "$(TargetDir)$(TargetName).cmp" "-orbis"' } Condition [ProjectType=='Exe'&&Platform=='Xbox 360'] { Settings.BuildEvents.PostBuild.Description = 'Check 32Mb Text segment. Compress map. Deploy .cmp.' Settings.BuildEvents.PostBuild.Command << 'ruby "dumpbin.exe $(TargetPath)" _NEWLINE_' Settings.BuildEvents.PostBuild.Command << 'if errorlevel == 0 goto BuildEventOK _NEWLINE_' Settings.BuildEvents.PostBuild.Command << 'echo dumpbin for $(ProjectName) FAILED _NEWLINE_' Settings.BuildEvents.PostBuild.Command << 'exit 1 _NEWLINE_' Settings.BuildEvents.PostBuild.Command << ':BuildEventOK _NEWLINE_' Settings.BuildEvents.PostBuild.Command << 'echo dumpbin for $(ProjectName) OK _NEWLINE_' Settings.BuildEvents.PostBuild.Command << ' "$(TargetDir)$(TargetName).map" _NEWLINE_' Settings.BuildEvents.PostBuild.Command << ' /nologo "$(TargetDir)$(TargetName).cmp" $(RemoteRoot)\$(TargetName).cmp' } Condition [ProjectType=='Exe'&&Platform=='Durango'] { Settings.BuildEvents.PostBuild.Description = 'Post Build Steps.' Settings.BuildEvents.PostBuild.Command << 'if not exist "$(RS_TITLE_UPDATE)" md "$(RS_TITLE_UPDATE)" _NEWLINE_' Settings.BuildEvents.PostBuild.Command << ' "$(TargetDir)$(TargetName).map" "$(TargetDir)$(TargetName).cmp" -durango _NEWLINE_' # Remove the .map file as we have the .cmp file otherwise it will be copied to the loose foler and deployed to the console with each run. Settings.BuildEvents.PostBuild.Command << 'del "$(TargetDir)$(TargetName).map" _NEWLINE_' Settings.BuildEvents.PostBuild.Command << 'copy /Y "$(TargetDir)\*.*" "$(RS_TITLE_UPDATE)" _NEWLINE_' # Copy rfs.dat file. Settings.BuildEvents.PostBuild.Command << 'copy /Y "c:\rfs.dat" "$(TargetDir)" _NEWLINE_' # Copy logos to the build folder so that they can be included when builds are ready. # NOTE: These might want to be removed from here and manually added to the build folder! Settings.BuildEvents.PostBuild.Command << 'copy /Y "$(ProjectDir)*.png" "$(RS_TITLE_UPDATE)" _NEWLINE_' } Condition [ProjectType=='Exe'&&Platform=='Win32'] { Settings.BuildEvents.PostBuild.Description = 'Compress map.' Settings.BuildEvents.PostBuild.Command << ' "$(TargetDir)$(TargetName).map"' } Condition [ProjectType=='Exe'&&Platform=='x64'] { Settings.BuildEvents.PostBuild.Description = 'Compress map.' Settings.BuildEvents.PostBuild.Command << ' "$(TargetDir)$(TargetName).map"' } }