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.

139 lines
5.0 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 OUTBINDIR "$OUTBINDIR$PLATSUBDIR"
  11. $Macro LIBPUBLIC "$SRCDIR\lib\public$PLATSUBDIR"
  12. $Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR" [!$VS2015]
  13. $Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR\2015\release" [$VS2015&&!$WIN32]
  14. $Macro LIBCOMMON "$SRCDIR\lib\common\win32\2015\release" [$VS2015&&$WIN32]
  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;_DLL_EXT=$_DLL_EXT"
  32. $PreprocessorDefinitions "$BASE;DLLNAME=$OUTBINNAME"
  33. }
  34. $Compiler [$WIN32]
  35. {
  36. $EnableEnhancedInstructionSet "Streaming SIMD Extensions (/arch:SSE)"
  37. }
  38. $Linker
  39. {
  40. $AdditionalDependencies "$BASE shell32.lib user32.lib advapi32.lib gdi32.lib comdlg32.lib ole32.lib" [$WIN32||$WIN64]
  41. $TargetMachine "MachineX86 (/MACHINE:X86)" [$WIN32]
  42. $TargetMachine "MachineX64 (/MACHINE:X64)" [$WIN64]
  43. // Suppress this pointless warning using the undocumented /ignore linker switch
  44. // 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
  45. $AdditionalOptions "$BASE /ignore:4221"
  46. $AdditionalOptions "$BASE $SRCDIR\lib\public\ftol3.obj" [$VS2013 && $WIN32 && !$DISABLE_FTOL3_OVERRIDE && !$SOURCESDK] // 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#
  47. }
  48. $PreBuildEvent
  49. {
  50. $CommandLine "if EXIST $OUTBINDIR\$(TargetFileName) for /f $QUOTEdelims=$QUOTE %%A in ('attrib $QUOTE$OUTBINDIR\$(TargetFileName)$QUOTE') do set valveTmpIsReadOnly=$QUOTE%%A$QUOTE" "\n" \
  51. "set valveTmpIsReadOnlyLetter=%valveTmpIsReadOnly:~6,1%" "\n" \
  52. "if $QUOTE%valveTmpIsReadOnlyLetter%$QUOTE==$QUOTER$QUOTE del /q $QUOTE$(TargetDir)$QUOTE$(TargetFileName)" "\n" \
  53. "$CRCCHECK" "\n"
  54. }
  55. $PostBuildEvent [!$ANALYZE]
  56. {
  57. $CommandLine "if not exist $QUOTE$OUTBINDIR$QUOTE mkdir $QUOTE$OUTBINDIR$QUOTE" "\n"
  58. $CommandLine "$BASE" "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $QUOTE$OUTBINDIR\$(TargetFileName)$QUOTE $SRCDIR" "\n" [!$SOURCESDK]
  59. $CommandLine "$BASE" "copy $QUOTE$(TargetDir)$(TargetFileName)$QUOTE $QUOTE$OUTBINDIR\$(TargetFileName)$QUOTE" "\n" \
  60. "if ERRORLEVEL 1 goto BuildEventFailed" "\n" \
  61. "if exist $QUOTE$(TargetDir)$(TargetName).map$QUOTE copy $QUOTE$(TargetDir)$(TargetName).map$QUOTE $OUTBINDIR\$(TargetName).map" "\n"
  62. $CommandLine "$BASE" "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $QUOTE$OUTBINDIR\$(TargetName).pdb$QUOTE $SRCDIR" "\n" [!$SOURCESDK]
  63. $CommandLine "$BASE" "copy $QUOTE$(TargetDir)$(TargetName).pdb$QUOTE $OUTBINDIR\$(TargetName).pdb" "\n" \
  64. "if ERRORLEVEL 1 goto BuildEventFailed" "\n" \
  65. "goto BuildEventOK" "\n" \
  66. ":BuildEventFailed" "\n" \
  67. "echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! EXE or DLL is probably running. ***" "\n" \
  68. "del /q $QUOTE$(TargetDir)$(TargetFileName)$QUOTE" "\n" \
  69. "exit 1" "\n" \
  70. ":BuildEventOK" "\n"
  71. $Description "Publishing to $OUTBINDIR"
  72. $ExcludedFromBuild "No"
  73. }
  74. }
  75. // Skeleton Project - All derived projects get this as a starting base
  76. $Project
  77. {
  78. $Folder "Source Files"
  79. {
  80. $File "$SRCDIR\public\tier0\memoverride.cpp"
  81. {
  82. $Configuration
  83. {
  84. $Compiler
  85. {
  86. $Create/UsePrecompiledHeader "Not Using Precompiled Headers"
  87. }
  88. }
  89. }
  90. // Implement __imp__EncodePointer and __imp__DecodePointer so that we can run on XP SP1
  91. // when building with VS 2010 and higher.
  92. $File "$SRCDIR\public\tier0\pointeroverride.asm" [$WIN32]
  93. {
  94. $Configuration
  95. {
  96. $CustomBuildStep
  97. {
  98. // General
  99. $CommandLine "$QUOTE$(VCInstallDir)bin\ml.exe$QUOTE /safeseh /c /Cp /Zi /Fo$QUOTE$(IntDir)\$(InputName).obj$QUOTE $QUOTE$(InputPath)$QUOTE"
  100. $Description "Compiling pointeroverride.asm"
  101. $Outputs "$(IntDir)\$(InputName).obj"
  102. }
  103. }
  104. }
  105. $File "$SRCDIR\common\debug_dll_check.cpp" [!$SOURCESDK]
  106. {
  107. $Configuration
  108. {
  109. $Compiler
  110. {
  111. $Create/UsePrecompiledHeader "Not Using Precompiled Headers"
  112. }
  113. }
  114. }
  115. }
  116. $Folder "Link Libraries"
  117. {
  118. $Implib "$LIBPUBLIC\tier0"
  119. $Lib "$LIBPUBLIC\tier1"
  120. $Implib "$LIBPUBLIC\vstdlib"
  121. }
  122. }