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.

194 lines
20 KiB

  1. $Include "$SRCDIR\vpc_scripts\source_lowest_base.vpc"
  2. $Configuration
  3. {
  4. $General
  5. {
  6. // Request a specific compiler toolset.
  7. $PlatformToolset "v110_xp" [$VS2012 && !$ANALYZE] // VS 2012 targeting Windows XP - http://msdn.microsoft.com/en-us/library/vstudio/jj851139.aspx
  8. $PlatformToolset "v110" [$VS2012 && $ANALYZE] // VS 2012 for /analyze
  9. $PlatformToolset "v120_xp" [$VS2013 && !$ANALYZE] // VS 2013 targeting Windows XP - http://msdn.microsoft.com/en-us/library/vstudio/jj851139.aspx
  10. $PlatformToolset "v120" [$VS2013 && $ANALYZE] // VS 2013 for /analyze
  11. $PlatformToolset "v140" [$VS2015]
  12. }
  13. $General
  14. {
  15. $ExecutableDirectories "$(ExecutablePath);$(Path)"
  16. // 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
  17. $ExecutableDirectories "$SRCDIR\devtools\vstools;$BASE" [$WIN32]
  18. // VS 2012 compiles fine but does not link. We want to redirect to stub versions of
  19. // the tools (like link.exe and mt.exe) so that the link stage will be NOPed when
  20. // doing /analyze builds.
  21. $ExecutableDirectories "$SRCDIR\devtools\vs_nop_tools;$BASE" [$ANALYZE]
  22. }
  23. $Compiler
  24. {
  25. $MultiProcessorCompilation "True"
  26. // warning C4316: object allocated on the heap may not be aligned 16
  27. $DisableSpecificWarnings "$BASE;4316" [$VS2013]
  28. // When using /analyze (triggered with /define:ANALYZE on the vpc command line) we want to forcibly disable lots
  29. // of warnings (also disabled in platform.h but not everybody includes that).
  30. // See platform.h for the list of warnings with explanations.
  31. // Note that /analyze for VS 2010 only works with the 32-bit compiler, but for VS 2012 it works on 64-bit
  32. // as well.
  33. // warning C6296: Ill-defined for-loop. Loop body only executed once.
  34. $DisableSpecificWarnings "$BASE;6308;6255;6387;6309;6011;6211;6031;6326;6239;6285;6237;6235;6240;6323;6335;6320;6250;6384;6318;6322;6296" [$ANALYZE]
  35. // See http://randomascii.wordpress.com/2011/10/04/analyzecommand-line-options/ for details on these options.
  36. // /analyze:only may result in fewer warnings being reported, but the warnings it misses should show up in the regular build.
  37. $AdditionalOptions "$BASE /analyze /analyze:stacksize100000" [$ANALYZE]
  38. $AdditionalOptions "$BASE /analyze:only" [$ANALYZE && $ANALYZE_MACHINE] // /analyze:only makes builds faster on buildbot but is terrible for incremental /analyze on developer machines
  39. // Specify /define:ALLOWSHADOWING to suppress variable shadowing warnings
  40. $DisableSpecificWarnings "$BASE;6244;6246" [$ANALYZE && $ALLOWSHADOWING]
  41. // warning C28125: The function 'InitializeCriticalSection' must be called from within a try\except block
  42. // warning C28160: Error annotation: Calling VirtualFreeEx without the MEM_RELEASE flag frees memory but not address descriptors (VADs); results in address space leaks.
  43. // warning C6248: Setting a SECURITY_DESCRIPTOR's DACL to NULL will result in an unprotected object.
  44. // warning C6102: Using value from failed function call
  45. $DisableSpecificWarnings "$BASE;28125;28160;6248;6102" [$ANALYZE && ($VS2012 || $VS2013 || $VS2015)]
  46. //Disable specific warnings.
  47. // Note parentheses warning level and possibly an 'X' to denote that it's disabled by default (overridden with "/Wall")
  48. // Warning Levels:
  49. // 1 - Severe
  50. // 2 - Significant
  51. // 3 - Production Quality
  52. // 4 - Informational
  53. // ? - No level found. Generally these are "/Wall" and probably level 4 in severity
  54. // A - /analyze only
  55. $DisableSpecificWarnings "$BASE;4061" //(4X) enumerator 'identifier' in switch of enum 'enumeration' is not explicitly handled by a case label
  56. $DisableSpecificWarnings "$BASE;4062" //(4X) enumerator 'identifier' in switch of enum 'enumeration' is not handled
  57. $DisableSpecificWarnings "$BASE;4091" //(1) keyword': ignored on left of 'type' when no variable is declared
  58. $DisableSpecificWarnings "$BASE;4097" //(1) expected pragma parameter to be 'restore' or 'off'
  59. $DisableSpecificWarnings "$BASE;4100" //(4) 'identifier': unreferenced formal parameter
  60. $DisableSpecificWarnings "$BASE;4121" //(4) 'symbol': alignment of a member was sensitive to packing
  61. $DisableSpecificWarnings "$BASE;4127" //(4) conditional expression is constant
  62. $DisableSpecificWarnings "$BASE;4189" [$PROFILE || $RETAIL] //(4) 'identifier': local variable is initialized but not referenced. Ignored when there's a high probability of variables only being used by assertions that are disabled
  63. $DisableSpecificWarnings "$BASE;4191" //(3X) 'operator/operation': unsafe conversion from 'type_of_expression' to 'type_required'. Calling this function through the result pointer may cause your program to fail
  64. $DisableSpecificWarnings "$BASE;4201" //(4) nonstandard extension used: nameless struct/union
  65. $DisableSpecificWarnings "$BASE;4239" //(4) nonstandard extension used: 'token': conversion from 'type1' to 'type2'
  66. $DisableSpecificWarnings "$BASE;4242" //(4X) 'identfier': conversion from 'type1' to 'type1', possible loss of data
  67. $DisableSpecificWarnings "$BASE;4244" [!$STRICT_TYPE_CONVERSION_WARNINGS_ACTIVE] //(2) 'conversion_type': conversion from 'type1' to 'type2', possible loss of data
  68. $DisableSpecificWarnings "$BASE;4250" //(2) 'classname': inherits 'base_classname::member' via dominance
  69. $DisableSpecificWarnings "$BASE;4254" //(4X) 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
  70. $DisableSpecificWarnings "$BASE;4255" //(4X) 'function': no function prototype given: converting '()' to '(void)'
  71. $DisableSpecificWarnings "$BASE;4263" //(4X) 'function': member function does not override any base class virtual member function
  72. $DisableSpecificWarnings "$BASE;4264" //(1X) 'virtual_function': no override available for virtual member function from base 'classname'; function is hidden
  73. $DisableSpecificWarnings "$BASE;4265" //(3X) 'classname': class has virtual functions, but destructor is not virtual. instances of this class may not be destructed correctly
  74. $DisableSpecificWarnings "$BASE;4266" //(4X) 'virtual_function': no override available for virtual member function from base 'classname'; function is hidden
  75. $DisableSpecificWarnings "$BASE;4296" //(4X) 'operator': expression is always 'boolean_value'
  76. $DisableSpecificWarnings "$BASE;4302" //(2X) 'conversion': truncation from 'type1' to 'type2'
  77. $DisableSpecificWarnings "$BASE;4311" //(1X) 'variable': pointer truncation from 'type1' to 'type2'
  78. $DisableSpecificWarnings "$BASE;4316" //(3) 'identifier': object allocated on the heap may not be aligned 'alignment'
  79. $DisableSpecificWarnings "$BASE;4324" //(4) 'structname': structure was padded due to __declspec(align())
  80. $DisableSpecificWarnings "$BASE;4350" //(1X) behavior change: 'member1' called instead of 'member2'
  81. $DisableSpecificWarnings "$BASE;4351" //(1) new behavior: elements of array 'array' will be default initialized
  82. $DisableSpecificWarnings "$BASE;4355" //(1X) 'this': used in base member initializer list
  83. $DisableSpecificWarnings "$BASE;4365" //(4X) 'expression': conversion from 'type1' to 'type2', signed/unsigned mismatch
  84. $DisableSpecificWarnings "$BASE;4371" //(3X) 'classname': layout of class may have changed from a previous version of the compiler due to better packing of member 'member'
  85. $DisableSpecificWarnings "$BASE;4388" //(4X) 'comparison': signed/unsigned mismatch
  86. $DisableSpecificWarnings "$BASE;4435" //(4X) 'derived_class': Object layout under /vd2 will change due to virtual base 'base_class'
  87. $DisableSpecificWarnings "$BASE;4456" [$ALLOWSHADOWING] //(3) declaration of 'identifier' hides previous local declaration
  88. $DisableSpecificWarnings "$BASE;4457" [$ALLOWSHADOWING] //(3) declaration of 'identifier' hides function parameter
  89. $DisableSpecificWarnings "$BASE;4458" [$ALLOWSHADOWING] //(3) declaration of 'identifier' hides class member
  90. $DisableSpecificWarnings "$BASE;4459" [$ALLOWSHADOWING] //(3) declaration of 'identifier' hides global declaration
  91. $DisableSpecificWarnings "$BASE;4464" //(?X) relative include path contains '..'
  92. $DisableSpecificWarnings "$BASE;4471" //(4X) 'enumeration': a forward declaration of an unscoped enumeration must have an underlying type (int assumed)
  93. $DisableSpecificWarnings "$BASE;4481" //(4) nonstandard extension used: override specifier 'keyword'
  94. $DisableSpecificWarnings "$BASE;4505" //(4) 'function': unreferenced local function has been removed
  95. $DisableSpecificWarnings "$BASE;4511" //(3) 'class': copy constructor was implicitly defined as deleted
  96. $DisableSpecificWarnings "$BASE;4512" //(4) 'class': assignment operator was implicitly defined as deleted
  97. $DisableSpecificWarnings "$BASE;4514" //(4X) 'function': unreferenced inline function has been removed
  98. $DisableSpecificWarnings "$BASE;4530" //(1) C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
  99. $DisableSpecificWarnings "$BASE;4544" //(1) 'declaration': default template argument ignored on this template declaration
  100. $DisableSpecificWarnings "$BASE;4547" //(1X) 'operator': operator before comma has no effect; expected operator with side-effect
  101. $DisableSpecificWarnings "$BASE;4548" //(1X) expression before comma has no effect; expected expression with side-effect
  102. //$DisableSpecificWarnings "$BASE;4555" //(1X) expression has no effect; expected expression with side-effect
  103. $DisableSpecificWarnings "$BASE;4571" //(4X) Informational: catch(...) semantics changed since Visual C++ 7.1; structured exceptions (SEH) are no longer caught
  104. $DisableSpecificWarnings "$BASE;4574" //(4X) 'Identifier' is defined to be '0': did you mean to use '#if identifier'?
  105. $DisableSpecificWarnings "$BASE;4577" //(?X) 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc
  106. $DisableSpecificWarnings "$BASE;4587" //(1) 'anonymous_structure': behavior change: constructor is no longer implicitly called
  107. $DisableSpecificWarnings "$BASE;4611" //(4) interaction between 'function' and C++ object destruction is non-portable
  108. $DisableSpecificWarnings "$BASE;4619" //(3X) #pragma warning: there is no warning number 'number'
  109. $DisableSpecificWarnings "$BASE;4623" //(4X) 'derived class': default constructor was implicitly defined as deleted because a base class default constructor is inaccessible or deleted
  110. $DisableSpecificWarnings "$BASE;4625" //(4X) 'derived class': copy constructor was implicitly defined as deleted because a base class copy constructor is inaccessible or deleted
  111. $DisableSpecificWarnings "$BASE;4626" //(4X) 'derived class': assignment operator was implicitly defined as deleted because a base class assignment operator is inaccessible or deleted
  112. $DisableSpecificWarnings "$BASE;4628" //(1X) digraphs not supported with -Ze. Character sequence 'digraph' not interpreted as alternate token for '%s'
  113. $DisableSpecificWarnings "$BASE;4640" //(3X) 'instance': construction of local static object is not thread-safe
  114. $DisableSpecificWarnings "$BASE;4647" //(?X) call to undefined 'constexpr' function results in a non-constant expression
  115. $DisableSpecificWarnings "$BASE;4668" //(4X) 'symbol' is not defined as a preprocessor macro, replacing with '0' for 'directive'
  116. $DisableSpecificWarnings "$BASE;4702" //(4) unreachable code
  117. $DisableSpecificWarnings "$BASE;4710" //(4X) 'function': function not inlined
  118. $DisableSpecificWarnings "$BASE;4711" //(1) function 'function' selected for automatic inline expansion
  119. $DisableSpecificWarnings "$BASE;4738" //(3X) storing 32-bit float result in memory, possible loss of performance
  120. $DisableSpecificWarnings "$BASE;4748" //(?) /GS can not protect parameters and local variables from local buffer overrun because optimizations are disabled in function
  121. $DisableSpecificWarnings "$BASE;4774" //(4X) �<function>� : format string expected in argument <position> is not a string literal
  122. $DisableSpecificWarnings "$BASE;4777" //(4X) �<function>� : format string �<format-string>� requires an argument of type �<type>�, but variadic argument <position> has type �<type>�
  123. $DisableSpecificWarnings "$BASE;4786" //(?X) long symbol name
  124. $DisableSpecificWarnings "$BASE;4820" //(4X) 'bytes' bytes padding added after construct 'member_name'
  125. $DisableSpecificWarnings "$BASE;4826" //(2X) Conversion from 'type1 ' to 'type_2' is sign-extended. This may cause unexpected runtime behavior.
  126. $DisableSpecificWarnings "$BASE;4868" //(?X) 'file(line_number)' compiler may not enforce left-to-right evaluation order in braced initialization list
  127. $DisableSpecificWarnings "$BASE;4883" //(?X) function size suppresses optimizations
  128. $DisableSpecificWarnings "$BASE;4917" //(1X) 'declarator': a GUID can only be associated with a class, interface or namespace
  129. $DisableSpecificWarnings "$BASE;4928" //(1X) illegal copy-initialization; more than one user-defined conversion has been implicitly applied
  130. $DisableSpecificWarnings "$BASE;4946" //(1X) reinterpret_cast used between related classes: 'class1' and 'class2'
  131. $DisableSpecificWarnings "$BASE;4986" //(?X) 'function': exception specification does not match previous declaration
  132. $DisableSpecificWarnings "$BASE;4987" //(4X) nonstandard extension used: 'throw (...)'
  133. $DisableSpecificWarnings "$BASE;4996" //(3) functions declared deprecated
  134. $DisableSpecificWarnings "$BASE;5026" [$AT_LEAST_VS2015] //(?X) 'derived class' : move constructor was implicitly defined as deleted because a base class move constructor is inaccessible or deleted
  135. $DisableSpecificWarnings "$BASE;5027" [$AT_LEAST_VS2015] //(?X) 'derived class' : move assignment operator was implicitly defined as deleted because a base class move constructor is inaccessible or deleted
  136. $DisableSpecificWarnings "$BASE;5029" [$AT_LEAST_VS2015] //(?X) nonstandard extension used: alignment attributes in C++ apply to variables, data members and tag types only
  137. $DisableSpecificWarnings "$BASE;5031" [$AT_LEAST_VS2015] //(?X) #pragma warning(pop): likely mismatch, popping warning state pushed in different file
  138. $DisableSpecificWarnings "$BASE;5032" [$AT_LEAST_VS2015] //(?X) detected #pragma warning(push) with no corresponding #pragma warning(pop)
  139. $DisableSpecificWarnings "$BASE;6011" [$ANALYZE] //(A) dereferencing NULL pointer <name>
  140. $DisableSpecificWarnings "$BASE;6014" [$ANALYZE] //(A) Leaking memory.
  141. $DisableSpecificWarnings "$BASE;6031" [$ANALYZE] //(A) return value ignored: <function> could return unexpected value
  142. $DisableSpecificWarnings "$BASE;6211" [$ANALYZE] //(A) Leaking memory <pointer> due to an exception. Consider using a local catch block to clean up memory
  143. $DisableSpecificWarnings "$BASE;6235" [$ANALYZE] //(A) (<non-zero constant> || <expression>) is always a non-zero constant
  144. $DisableSpecificWarnings "$BASE;6237" [$ANALYZE] //(A) (<zero> && <expression>) is always zero. <expression> is never evaluated and may have side effects
  145. $DisableSpecificWarnings "$BASE;6239" [$ANALYZE] //(A) (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
  146. $DisableSpecificWarnings "$BASE;6240" [$ANALYZE] //(A) (<expression> && <non-zero constant>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
  147. $DisableSpecificWarnings "$BASE;6244" [$ALLOWSHADOWING && $ANALYZE] //(A) local declaration of <variable> hides previous declaration at <line> of <file>
  148. $DisableSpecificWarnings "$BASE;6246" [$ALLOWSHADOWING && $ANALYZE] //(A) Local declaration of <variable> hides declaration of same name in outer scope. Additional Information: See previous declaration at <location>.
  149. $DisableSpecificWarnings "$BASE;6250" [$ANALYZE] //(A) Calling <function> VirtualFree without the MEM_RELEASE flag may free memory but not address descriptors (VADs); results in address space leaks
  150. $DisableSpecificWarnings "$BASE;6255" [$ANALYZE] //(A) _alloca indicates failure by raising a stack overflow exception. Consider using _malloca instead
  151. $DisableSpecificWarnings "$BASE;6285" [$ANALYZE] //(A) (<non-zero constant> || <non-zero constant>) is always a non-zero constant. Did you intend to use the bitwise-and operator?
  152. $DisableSpecificWarnings "$BASE;6308" [$ANALYZE] //(A) 'realloc' may return null pointer: assigning a null pointer to <variable>, which is passed as an argument to 'realloc', will cause the original memory block to be leaked
  153. $DisableSpecificWarnings "$BASE;6309" [$ANALYZE] //(A) argument <number> is null: it does not adhere to function specification of <function>
  154. $DisableSpecificWarnings "$BASE;6318" [$ANALYZE] //(A) Ill-defined __try/__except: use of the constant EXCEPTION_CONTINUE_SEARCH or another constant that evaluates to zero in the exception-filter expression. The code in the exception handler block is not executed
  155. $DisableSpecificWarnings "$BASE;6320" [$ANALYZE] //(A) exception-filter expression is the constant EXCEPTION_EXECUTE_HANDLER. This may mask exceptions that were not intended to be handled
  156. $DisableSpecificWarnings "$BASE;6322" [$ANALYZE] //(A) empty _except block
  157. $DisableSpecificWarnings "$BASE;6323" [$ANALYZE] //(A) use of arithmetic operator on Boolean type(s)
  158. $DisableSpecificWarnings "$BASE;6326" [$ANALYZE] //(A) potential comparison of a constant with another constant
  159. $DisableSpecificWarnings "$BASE;6335" [$ANALYZE] //(A) leaking process information handle <handlename>
  160. $DisableSpecificWarnings "$BASE;6340" [$ANALYZE] //(A) Mismatch on sign: Incorrect type passed as parameter in call to function
  161. $DisableSpecificWarnings "$BASE;6384" [$ANALYZE] //(A) dividing sizeof a pointer by another value
  162. $DisableSpecificWarnings "$BASE;6387" [$ANALYZE] //(A) <argument> may be <value>: this does not adhere to the specification for the function <function name>: Lines: x, y
  163. $DisableSpecificWarnings "$BASE;28159" [$ANALYZE] //(A) Consider using another function instead.
  164. $DisableSpecificWarnings "$BASE;28182" [$ANALYZE] //(A) Dereferencing NULL pointer.
  165. $DisableSpecificWarnings "$BASE;28183" [$ANALYZE] //(A) The argument could be one value, and is a copy of the value found in the pointer
  166. $DisableSpecificWarnings "$BASE;28195" [$ANALYZE] //(A) The function was declared as acquiring memory in a variable and exited without doing so
  167. $DisableSpecificWarnings "$BASE;28197" [$ANALYZE] //(A) Possibly leaking memory
  168. $DisableSpecificWarnings "$BASE;28198" [$ANALYZE] //(A) Possibly leaking memory due to an exception.
  169. $DisableSpecificWarnings "$BASE;28204" [$ANALYZE] //(A) <function> : Only one of this overload and the one at <filename>(<line>) are annotated for <paramname>: both or neither must be annotated.
  170. $DisableSpecificWarnings "$BASE;28247" [$ANALYZE] //(A) Model file annotation for function '_vsnprintf': annotation on _Param_(1)/SAL_post, 'RequiresZeroTermination' duplicates header file annotation 'SAL_nullTerminated'. Remove the duplicated annotations from the model file. (Header: c:\program files (x86)\microsoft visual studio 11.0\vc\include\stdio.h(349).)
  171. $DisableSpecificWarnings "$BASE;28251" [$ANALYZE] //(A) Inconsistent annotation for function: this instance has an error
  172. $DisableSpecificWarnings "$BASE;28301" [$ANALYZE] //(A) No annotations for first declaration of <function>.<note1> See <filename>(<line>). <note2>
  173. // Defines to differentiate 32 from 64 bit builds
  174. $PreprocessorDefinitions "$BASE;PLATFORM_64BITS;WIN64;_WIN64;COMPILER_MSVC64" [$WIN64]
  175. $PreprocessorDefinitions "$BASE;COMPILER_MSVC32" [$WIN32]
  176. // /Gw is a VS 2013 option that puts global and static variables in individual sections so that the
  177. // linker can discard unreferenced data. When building @client /dota with linker optimizations this
  178. // reduces the client.dll size by about 1.14%. When linker optimizations are disabled this has no
  179. // effect. This option does not show up in the IDE so we need to add it in $AdditionalOptions.
  180. // http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
  181. $AdditionalOptions "$BASE /Gw" [$VS2013]
  182. }
  183. }