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.

72 lines
3.7 KiB

  1. // Settings for /analyze are in a separate .vpc file so that they can be
  2. // changed without triggering a full rebuild of non-analyze builds. On non-analyze
  3. // builds the analyze.vpc file will not be listed as a dependency.
  4. $Include "$SRCDIR\vpc_scripts\source_win32_analyze.vpc" [$ANALYZE]
  5. $Conditional $AT_LEAST_VS2015 "true" [$VS2015]
  6. $Conditional $AT_LEAST_VS2013 "true" [$VS2013 || $AT_LEAST_VS2015]
  7. $Configuration
  8. {
  9. $General
  10. {
  11. // Request a specific compiler toolset.
  12. $PlatformToolset "v100" [$VS2010]
  13. $PlatformToolset "v110_xp" [$VS2012 && !$ANALYZE] // VS 2012 targeting Windows XP - http://msdn.microsoft.com/en-us/library/vstudio/jj851139.aspx
  14. $PlatformToolset "v110" [$VS2012 && $ANALYZE] // VS 2012 for /analyze
  15. $PlatformToolset "v120_xp" [$VS2013 && !$ANALYZE] // VS 2013 targeting Windows XP - http://msdn.microsoft.com/en-us/library/vstudio/jj851139.aspx
  16. $PlatformToolset "v120" [$VS2013 && $ANALYZE] // VS 2013 for /analyze
  17. $PlatformToolset "v140_xp" [$VS2015 && !$ANALYZE] // VS 2015 for /analyze
  18. $PlatformToolset "v140" [$VS2015 && $ANALYZE] // VS 2015 for /analyze
  19. }
  20. $General
  21. {
  22. $ExecutableDirectories "$(ExecutablePath);$(Path)"
  23. // We need to override mt.exe for Win7 compatibiity. Append paths before $(ExecutablePath) if you need VS to use your tools rather than its own
  24. $ExecutableDirectories "$SRCDIR\devtools\vstools;$BASE"
  25. // VS 2012 compiles fine but does not link. We want to redirect to stub versions of
  26. // the tools (like link.exe and mt.exe) so that the link stage will be NOPed when
  27. // doing /analyze builds.
  28. $ExecutableDirectories "$SRCDIR\devtools\vs_nop_tools;$BASE" [$ANALYZE]
  29. }
  30. $Compiler
  31. {
  32. $MultiProcessorCompilation "True"
  33. // warning C4316: object allocated on the heap may not be aligned 16
  34. $DisableSpecificWarnings "$BASE;4316" [$AT_LEAST_VS2013]
  35. // following are needed for VS2015 using old Windows SDK. Would like to move to each include location
  36. $DisableSpecificWarnings "$BASE;4577;4091" [$WINDOWS && $AT_LEAST_VS2015]
  37. // Having lots of warnings makes it harder to notice new, and possibly
  38. // important warnings, both on buildbot and in the output window. Lots
  39. // of warnings also makes it harder to skip through errors in the output
  40. // window since F8 stops on both warnings and errors. The only way to
  41. // keep the warning count down is to have warnings-as-errors.
  42. // We will not be warning free on 64-bit for a while...
  43. $TreatWarningsAsErrors "Yes (/WX)" [!$ANALYZE && !$WIN64]
  44. // Defines to differentiate 32 from 64 bit builds
  45. $PreprocessorDefinitions "$BASE;PLATFORM_64BITS;WIN64;_WIN64;COMPILER_MSVC64" [$WIN64]
  46. $PreprocessorDefinitions "$BASE;COMPILER_MSVC32" [$WIN32]
  47. // /Gw is a VS 2013 option that puts global and static variables in individual sections so that the
  48. // linker can discard unreferenced data. When building @client /dota with linker optimizations this
  49. // reduces the client.dll size by about 1.14%. When linker optimizations are disabled this has no
  50. // effect. This option does not show up in the IDE so we need to add it in $AdditionalOptions.
  51. // http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
  52. $AdditionalOptions "$BASE /Gw" [$AT_LEAST_VS2013]
  53. // Strip unreferenced inline functions from object files to shrink .obj files and .lib files,
  54. // improve linker speed, and improve conformance. Requires VS 2013 Update 3
  55. $AdditionalOptions "$BASE /Zc:inline" [$AT_LEAST_VS2013]
  56. $AdditionalOptions "$BASE /Zc:threadSafeInit-" [$AT_LEAST_VS2015] //thread-safe static initialization will crash on Windows XP if the dll is dynamically loaded
  57. $AdditionalOptions "$BASE /Wv:18" [$AT_LEAST_VS2015&&!$WARN_ALL] //warning C4456: declaration of 'accFactorZ' hides previous local declaration suppression
  58. }
  59. }