Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
4.3 KiB

  1. //-----------------------------------------------------------------------------
  2. // SOURCE_DLL_X360_BASE.VPC
  3. //
  4. // Base Settings for Source(TM) Projects
  5. //-----------------------------------------------------------------------------
  6. $Include "$SRCDIR\vpc_scripts\version.vpc"
  7. $MacroRequired "SRCDIR"
  8. $MacroRequired "OUTBINNAME" "$PROJECTNAME"
  9. $MacroRequired "OUTBINDIR"
  10. $MacroRequired "DEVKITBINDIR" "bin"
  11. // 360 must have a dll load address
  12. $Include "$SRCDIR\vpc_scripts\loadaddress.vpc"
  13. $MacroRequired "LOADADDRESS_DEVELOPMENT"
  14. $MacroRequired "LOADADDRESS_RETAIL"
  15. $MacroRequired "LOADADDRESSNAME"
  16. $Macro DLLDEMOSUFFIX "_demo\" [$DEMO]
  17. $MacroEmptyString DLLDEMOSUFFIX "empty" [!$DEMO]
  18. $Macro LIBPUBLIC "$SRCDIR\lib\public"
  19. $Macro LIBCOMMON "$SRCDIR\lib\common"
  20. $Include "$SRCDIR\vpc_scripts\source_dll_x360_debug.vpc"
  21. $Include "$SRCDIR\vpc_scripts\source_dll_x360_release.vpc"
  22. $IgnoreRedundancyWarning "ON"
  23. // Common Configuration
  24. $Configuration
  25. {
  26. $Compiler
  27. {
  28. $PreprocessorDefinitions "$BASE;_LOWVIOLENCE" [$LV]
  29. $PreprocessorDefinitions "$BASE;_X360DEMO" [$X360DEMO]
  30. $PreprocessorDefinitions "$BASE;COMPILER_MSVC;COMPILER_MSVCX360;_DLL_EXT=$_DLL_EXT"
  31. $PreprocessorDefinitions "$BASE;DLLNAME=$OUTBINNAME"
  32. }
  33. $Linker
  34. {
  35. // This ignores the linker error "export '<symbol>' specified multiple times; using first specification
  36. $AdditionalOptions "$BASE /IGNORE:4197"
  37. }
  38. $Xbox360ImageConversion
  39. {
  40. // All X360 DLLs must be signed with a special XML containing only version field
  41. // the version of the DLL must match the version of default.xex that is signed
  42. // with another XML including more settings (privileges, ratings, memory, etc.)
  43. // DLLs must NOT be signed with the XML used for XEX
  44. $ProjectDefaults "$SRCDIR\common\xlast_$VPCGAME$DLLDEMOSUFFIX\$VPCGAME""_dll.xml"
  45. }
  46. $ConsoleDeployment
  47. {
  48. $ExcludedFromBuild "Yes"
  49. $DeploymentRoot "xe:\$VPCGAME$DLLDEMOSUFFIX"
  50. }
  51. $PreBuildEvent
  52. {
  53. $CommandLine "if EXIST $OUTBINDIR\$(TargetFileName) for /f $QUOTEdelims=$QUOTE %%A in ('attrib $QUOTE$OUTBINDIR\$(TargetFileName)$QUOTE') do set valveTmpIsReadOnly=$QUOTE%%A$QUOTE" "\n" \
  54. "set valveTmpIsReadOnlyLetter=%valveTmpIsReadOnly:~6,1%" "\n" \
  55. "if $QUOTE%valveTmpIsReadOnlyLetter%$QUOTE==$QUOTER$QUOTE del /q $(TargetDir)$(TargetName)_converted.dll" "\n" \
  56. "$CRCCHECK" "\n"
  57. }
  58. $PostBuildEvent
  59. {
  60. $CommandLine "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTBINDIR\$(TargetFileName) $SRCDIR" "\n" \
  61. "copy $(TargetDir)$(TargetName)_converted.dll $OUTBINDIR\$(TargetFileName)" "\n" \
  62. "if exist $(TargetDir)$(TargetName).map copy $(TargetDir)$(TargetName).map $OUTBINDIR\$(TargetName).map" "\n" \
  63. "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTBINDIR\$(TargetName).pdb $SRCDIR" "\n" \
  64. "copy $(TargetDir)$(TargetName).pdb $OUTBINDIR\$(TargetName).pdb" "\n" \
  65. "copy $(TargetDir)$(TargetName).xdb $OUTBINDIR\$(TargetName).xdb" "\n" \
  66. "call $SRCDIR\vpc_scripts\valve_xbcp_wrapper.cmd $(TargetDir)$(TargetName)_converted.dll $(RemoteRoot)\$DEVKITBINDIR\$(TargetFileName)" "\n"
  67. $CommandLine "$BASE" \
  68. "echo LoadAddressName=$LOADADDRESSNAME > $(TargetDir)$(TargetName).vpcinfo" "\n" \
  69. "call $SRCDIR\vpc_scripts\valve_xbcp_wrapper.cmd $(TargetDir)$(TargetName).vpcinfo $(RemoteRoot)\$DEVKITBINDIR\$(TargetName).vpcinfo" "\n" [$VPCINFO]
  70. $Description "Publishing to $OUTBINDIR"
  71. $ExcludedFromBuild "No"
  72. }
  73. // this forces a dependency on the published directory
  74. // when the dependency fails (the dll was deleted), the PostBuildEvent will run, thus causing the publish to re-occur
  75. // this allows for faster debug/release flipping without having to recompile or relink
  76. $CustomBuildStep
  77. {
  78. // General
  79. $CommandLine "echo Checking Dependency $OUTBINDIR\$(TargetFileName)"
  80. $Description " "
  81. $Outputs "$OUTBINDIR\$(TargetFileName)"
  82. }
  83. }
  84. // Skeleton Project
  85. $Project
  86. {
  87. $Folder "Source Files"
  88. {
  89. $File "$SRCDIR\public\tier0\memoverride.cpp"
  90. {
  91. $Configuration
  92. {
  93. $Compiler
  94. {
  95. $Create/UsePrecompiledHeader "Not Using Precompiled Headers"
  96. }
  97. }
  98. }
  99. }
  100. $Folder "Xbox"
  101. {
  102. $File "xbox\xbox.def"
  103. }
  104. $Folder "Link Libraries"
  105. {
  106. $ImpLib "$LIBPUBLIC\tier0"
  107. $Lib "$LIBPUBLIC\tier1"
  108. $Implib "$LIBPUBLIC\vstdlib"
  109. $Lib "$LIBPUBLIC\interfaces"
  110. }
  111. }