Counter Strike : Global Offensive Source Code
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.

128 lines
4.6 KiB

  1. //-----------------------------------------------------------------------------
  2. // SOURCE_DLL_WIN32_BASE.VPC
  3. //
  4. // Base Settings for all Source(TM) Projects
  5. //-----------------------------------------------------------------------------
  6. $Include "$SRCDIR\vpc_scripts\version.vpc"
  7. $MacroRequired "SRCDIR"
  8. $MacroRequired "OUTBINNAME" "$PROJECTNAME"
  9. $MacroRequired "OUTBINDIR"
  10. $Macro PLATSUBDIR "\." [$WIN32]
  11. $Macro PLATSUBDIR "\x64" [$WIN64]
  12. $Macro OUTBINDIR "$OUTBINDIR$PLATSUBDIR"
  13. $Macro LIBPUBLIC "$SRCDIR\lib\public$PLATSUBDIR"
  14. $Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR"
  15. $Include "$SRCDIR\vpc_scripts\loadaddress.vpc"
  16. $Include "$SRCDIR\vpc_scripts\source_dll_win32_debug.vpc"
  17. $Include "$SRCDIR\vpc_scripts\source_dll_win32_release.vpc"
  18. $Include "$SRCDIR\vpc_scripts\source_win32_base.vpc"
  19. $IgnoreRedundancyWarning "ON"
  20. // Common Configuration
  21. $Configuration
  22. {
  23. $General
  24. {
  25. $TargetName "$OUTBINNAME"
  26. }
  27. $Compiler
  28. {
  29. $PreprocessorDefinitions "$BASE;PLATFORM_64BITS;WIN64;_WIN64;COMPILER_MSVC64" [$WIN64]
  30. $PreprocessorDefinitions "$BASE;COMPILER_MSVC32" [$WIN32]
  31. $PreprocessorDefinitions "$BASE;COMPILER_MSVC;MEMOVERRIDE_MODULE=$PROJECTNAME;_DLL_EXT=$_DLL_EXT"
  32. $PreprocessorDefinitions "$BASE;DLLNAME=$OUTBINNAME"
  33. $PreprocessorDefinitions "$BASE;PS3SDK_INSTALLED" [$PS3SDKINSTALLED]
  34. $PreprocessorDefinitions "$BASE;XDK_INSTALLED" [$XDKINSTALLED]
  35. }
  36. $Compiler [$WIN32] // This is already enabled for WIN64.
  37. {
  38. $EnableEnhancedInstructionSet "Streaming SIMD Extensions 2 (/arch:SSE2)"
  39. }
  40. $Linker
  41. {
  42. $AdditionalDependencies "$BASE shell32.lib user32.lib advapi32.lib gdi32.lib comdlg32.lib ole32.lib" [$WINDOWS]
  43. $TargetMachine "MachineX86 (/MACHINE:X86)" [$WIN32]
  44. $TargetMachine "MachineX64 (/MACHINE:X64)" [$WIN64]
  45. // Suppress this pointless warning using the undocumented /ignore linker switch
  46. // schemalib.lib(schemaclassinfo.obj) : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
  47. $AdditionalOptions "$BASE /ignore:4221"
  48. $AdditionalOptions "$BASE $SRCDIR\lib\public\ftol3.obj" [$VS2013 && $WIN32 && !$DISABLE_FTOL3_OVERRIDE] // Work around CRT bug https://connect.microsoft.com/VisualStudio/feedback/details/806362/vc12-pollutes-the-floating-point-stack-when-casting-infinity-nan-to-unsigned-long#
  49. }
  50. $PreBuildEvent
  51. {
  52. $CommandLine "if EXIST $OUTBINDIR\$(TargetFileName) for /f $QUOTEdelims=$QUOTE %%A in ('attrib $QUOTE$OUTBINDIR\$(TargetFileName)$QUOTE') do set valveTmpIsReadOnly=$QUOTE%%A$QUOTE" "\n" \
  53. "set valveTmpIsReadOnlyLetter=%valveTmpIsReadOnly:~6,1%" "\n" \
  54. "if $QUOTE%valveTmpIsReadOnlyLetter%$QUOTE==$QUOTER$QUOTE del /q $QUOTE$(TargetDir)$QUOTE$(TargetFileName)" "\n" \
  55. "$HOST_VPC_EXE -crc2 $QUOTE$VPC_OUTPUT_FILE$QUOTE" "\n"
  56. }
  57. $PostBuildEvent [!$ANALYZE]
  58. {
  59. $CommandLine "if exist $OUTBINDIR goto ValveStart" "\n" \
  60. "mkdir $OUTBINDIR" "\n" \
  61. ":ValveStart" "\n" \
  62. "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTBINDIR\$(TargetFileName) $SRCDIR" "\n" \
  63. "copy $QUOTE$(TargetDir)$QUOTE$(TargetFileName) $OUTBINDIR\$(TargetFileName)" "\n" \
  64. "if ERRORLEVEL 1 goto BuildEventFailed" "\n" \
  65. "if exist $QUOTE$(TargetDir)$QUOTE$(TargetName).map copy $QUOTE$(TargetDir)$QUOTE$(TargetName).map $OUTBINDIR\$(TargetName).map" "\n" \
  66. "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTBINDIR\$(TargetName).pdb $SRCDIR" "\n" \
  67. "copy $QUOTE$(TargetDir)$QUOTE$(TargetName).pdb $OUTBINDIR\$(TargetName).pdb" "\n" \
  68. "if ERRORLEVEL 1 goto BuildEventFailed" "\n" \
  69. "goto BuildEventOK" "\n" \
  70. ":BuildEventFailed" "\n" \
  71. "echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! EXE or DLL is probably running. ***" "\n" \
  72. "del /q $QUOTE$(TargetDir)$QUOTE$(TargetFileName)" "\n" \
  73. "exit 1" "\n" \
  74. ":BuildEventOK" "\n"
  75. $Description "Publishing to $OUTBINDIR"
  76. $ExcludedFromBuild "No"
  77. }
  78. }
  79. // Skeleton Project - All derived projects get this as a starting base
  80. $Project
  81. {
  82. $Folder "Source Files"
  83. {
  84. $File_NoPCH "$SRCDIR\public\tier0\memoverride.cpp"
  85. {
  86. $BuildOrderModifier "0x00000001"
  87. $Configuration
  88. {
  89. $Compiler
  90. {
  91. $Create/UsePrecompiledHeader "Not Using Precompiled Headers"
  92. }
  93. }
  94. }
  95. $File_NoPCH "$SRCDIR\common\debug_dll_check.cpp"
  96. {
  97. $BuildOrderModifier "0x00000001"
  98. $Configuration
  99. {
  100. $Compiler
  101. {
  102. $Create/UsePrecompiledHeader "Not Using Precompiled Headers"
  103. }
  104. }
  105. }
  106. }
  107. $Folder "Link Libraries"
  108. {
  109. $Implib "tier0"
  110. $Lib "tier1"
  111. $Lib "interfaces"
  112. $Implib "vstdlib"
  113. }
  114. }