compilerSettings.pp 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. #if $[eq $[USE_COMPILER], MSVC]
  2. #define COMPILER cl
  3. #define LINKER link
  4. #define LIBBER lib
  5. #define COMMONFLAGS /Gi-
  6. // use "unsafe" QIfist flt->int rounding only if FAST_FLT_TO_INT is defined
  7. #define OPTFLAGS /O2 /Ob1 /G6 $[if $[ne $[FAST_FLT_TO_INT],], /QIfist,]
  8. #define OPT1FLAGS /GZ
  9. // Note: Zi cannot be used on multiproc builds with precomp hdrs, Z7 must be used instead
  10. #defer DEBUGPDBFLAGS /Zi /Fd"$[osfilename $[target:%.obj=%.pdb]]"
  11. #defer DEBUGFLAGS /MDd $[BROWSEINFO_FLAG] $[DEBUGINFOFLAGS] $[DEBUGPDBFLAGS]
  12. #define RELEASEFLAGS /MD
  13. #define WARNING_LEVEL_FLAG /W3
  14. #define CDEFINES_OPT4 UNKNOWN_ALLOCATOR
  15. // NODEFAULTLIB ensures static libs linked in will connect to the correct msvcrt, so no debug/release mixing occurs
  16. #define LDFLAGS_OPT1 /NODEFAULTLIB:MSVCRT.LIB
  17. #define LDFLAGS_OPT2 /NODEFAULTLIB:MSVCRT.LIB
  18. #define LDFLAGS_OPT3 /NODEFAULTLIB:MSVCRTD.LIB /OPT:REF
  19. #define LDFLAGS_OPT4 /NODEFAULTLIB:MSVCRTD.LIB /OPT:REF $[LDFLAGS_OPT4]
  20. #define MAPINFOFLAGS /MAPINFO:EXPORTS /MAPINFO:FIXUPS /MAPINFO:LINES
  21. #if $[ENABLE_PROFILING]
  22. // note according to docs, this should force /PDB:none /DEBUGTYPE:cv, so no pdb file is generated for debug?? (doesnt seem to be true)
  23. #define PROFILE_FLAG /PROFILE
  24. #else
  25. #define PROFILE_FLAG
  26. #endif
  27. // Note: all Opts will link w/debug info now
  28. #define LINKER_FLAGS /DEBUG /DEBUGTYPE:CV $[PROFILE_FLAG] /MAP $[MAPINFOFLAGS] /fixed:no /incremental:no /WARN:3
  29. // in case we have mixed intel/msvc build
  30. #define EXTRA_LIBPATH /ia32/lib
  31. #define EXTRA_INCPATH /ia32/include
  32. #if $[or $[ne $[FORCE_INLINING],],$[>= $[OPTIMIZE],2]]
  33. #define EXTRA_CDEFS FORCE_INLINING $[EXTRA_CDEFS]
  34. #endif
  35. #elif $[eq $[USE_COMPILER], MSVC7]
  36. #define COMPILER cl
  37. #define LINKER link
  38. #define LIBBER lib
  39. #if $[eq $[NO_CROSSOBJ_OPT],]
  40. #define DO_CROSSOBJ_OPT 1
  41. #endif
  42. #if $[DO_CROSSOBJ_OPT]
  43. #define OPT4FLAGS /GL
  44. #define LDFLAGS_OPT4 /LTCG
  45. #if $[>= $[OPTIMIZE],4]
  46. #define LIBBER $[LIBBER] /LTCG
  47. #endif
  48. #endif
  49. // remove 1-3 when allocator stuff is rewritten to build with VC7 STL
  50. #define CDEFINES_OPT1 UNKNOWN_ALLOCATOR
  51. #define CDEFINES_OPT2 UNKNOWN_ALLOCATOR
  52. #define CDEFINES_OPT3 UNKNOWN_ALLOCATOR
  53. #define CDEFINES_OPT4 UNKNOWN_ALLOCATOR
  54. // NODEFAULTLIB ensures static libs linked in will connect to the correct msvcrt, so no debug/release mixing occurs
  55. #define LDFLAGS_OPT1 /NODEFAULTLIB:MSVCRT.LIB
  56. #define LDFLAGS_OPT2 /NODEFAULTLIB:MSVCRT.LIB
  57. #define LDFLAGS_OPT3 /NODEFAULTLIB:MSVCRTD.LIB /OPT:REF
  58. #define LDFLAGS_OPT4 /NODEFAULTLIB:MSVCRTD.LIB /OPT:REF $[LDFLAGS_OPT4]
  59. #define COMMONFLAGS /DHAVE_DINKUM /Zc:forScope
  60. // use "unsafe" QIfist flt->int rounding only if FAST_FLT_TO_INT is defined
  61. #define OPTFLAGS /O2 /Ob2 /G6 $[if $[ne $[FAST_FLT_TO_INT],], /QIfist,]
  62. // #define OPT1FLAGS /RTCsu /GS removing /GS cause we really dont need it, /RTCu because it crashes in dxgsg with internal compiler bug
  63. #define OPT1FLAGS /RTCs
  64. // #define WARNING_LEVEL_FLAG /Wall //this is scary
  65. #define WARNING_LEVEL_FLAG /W3 // WL
  66. // Note: Zi cannot be used on multiproc builds with precomp hdrs, Z7 must be used instead
  67. #defer DEBUGPDBFLAGS /Zi /Fd"$[osfilename $[target:%.obj=%.pdb]]"
  68. #defer DEBUGFLAGS /MDd $[BROWSEINFO_FLAG] $[DEBUGINFOFLAGS] $[DEBUGPDBFLAGS]
  69. #define RELEASEFLAGS /MD
  70. #define MAPINFOFLAGS /MAPINFO:EXPORTS /MAPINFO:LINES
  71. #if $[ENABLE_PROFILING]
  72. #define PROFILE_FLAG /FIXED:NO
  73. #else
  74. #define PROFILE_FLAG
  75. #endif
  76. #if $[or $[ne $[FORCE_INLINING],],$[>= $[OPTIMIZE],2]]
  77. #define EXTRA_CDEFS FORCE_INLINING $[EXTRA_CDEFS]
  78. #endif
  79. // Note: all Opts will link w/debug info now
  80. #define LINKER_FLAGS /DEBUG $[PROFILE_FLAG] /MAP $[MAPINFOFLAGS] /fixed:no /incremental:no
  81. // in case we have mixed intel/msvc build
  82. #define EXTRA_LIBPATH /ia32/lib
  83. #define EXTRA_INCPATH /ia32/include
  84. #elif $[eq $[USE_COMPILER], INTEL]
  85. #define COMPILER icl
  86. #define LINKER xilink
  87. #define LIBBER xilib
  88. #define COMMONFLAGS /DHAVE_DINKUM /Gi- /Qwd985 /Qvc7 /G6
  89. // Note: Zi cannot be used on multiproc builds with precomp hdrs, Z7 must be used instead
  90. #defer DEBUGPDBFLAGS /Zi /Qinline_debug_info /Fd"$[osfilename $[target:%.obj=%.pdb]]"
  91. // Oy- needed for MS debugger
  92. #defer DEBUGFLAGS /Oy- /MDd $[BROWSEINFO_FLAG] $[DEBUGINFOFLAGS] $[DEBUGPDBFLAGS]
  93. #define RELEASEFLAGS /MD
  94. #define WARNING_LEVEL_FLAG /W3
  95. #if $[DO_CROSSOBJ_OPT]
  96. #define OPT4FLAGS /Qipo
  97. #define LDFLAGS_OPT4 /Qipo
  98. #endif
  99. #define CDEFINES_OPT4 UNKNOWN_ALLOCATOR
  100. // NODEFAULTLIB ensures static libs linked in will connect to the correct msvcrt, so no debug/release mixing occurs
  101. #define LDFLAGS_OPT1 /NODEFAULTLIB:MSVCRT.LIB
  102. #define LDFLAGS_OPT2 /NODEFAULTLIB:MSVCRT.LIB
  103. #define LDFLAGS_OPT3 /NODEFAULTLIB:MSVCRTD.LIB /OPT:REF
  104. #define LDFLAGS_OPT4 /NODEFAULTLIB:MSVCRTD.LIB /OPT:REF $[LDFLAGS_OPT4]
  105. // #define OPTFLAGS /O3 /Qipo /QaxW /Qvec_report1
  106. #define OPTFLAGS /O3 /Qip
  107. // use "unsafe" QIfist flt->int rounding only if FAST_FLT_TO_INT is defined
  108. #define OPTFLAGS $[OPTFLAGS] $[if $[ne $[FAST_FLT_TO_INT],], /QIfist,]
  109. #define OPT1FLAGS /GZ /Od
  110. // We assume the Intel compiler installation dir is mounted as /ia32.
  111. #define EXTRA_LIBPATH /ia32/lib
  112. #define EXTRA_INCPATH /ia32/include
  113. #if $[or $[ne $[FORCE_INLINING],],$[>= $[OPTIMIZE],2]]
  114. #define EXTRA_CDEFS FORCE_INLINING $[EXTRA_CDEFS]
  115. #endif
  116. // Note: all Opts will link w/debug info now
  117. #define LINKER_FLAGS /DEBUG /DEBUGTYPE:CV $[PROFILE_FLAG] /MAP $[MAPINFOFLAGS] /fixed:no /incremental:no
  118. #elif $[eq $[USE_COMPILER], BOUNDS] // NuMega BoundsChecker
  119. #define COMPILER nmcl
  120. #define LINKER nmlink
  121. #define LIBBER lib
  122. #define COMMONFLAGS
  123. #define OPTFLAGS /O2 /Ogity /G6
  124. #define OPT1FLAGS /GZ
  125. #defer DEBUGFLAGS /MDd /Zi $[BROWSEINFO_FLAG] /Fd"$[osfilename $[target:%.obj=%.pdb]]"
  126. #define RELEASEFLAGS /MD
  127. #define EXTRA_LIBPATH
  128. #define EXTRA_INCPATH
  129. #if $[BOUNDS_TRUETIME] // NuMega BoundsChecker TrueTime Profiler
  130. // This may look like a bad thing (to extend the compiler
  131. // and linker with a switch), but I think it's the right
  132. // thing to do in this case -- skyler.
  133. #define COMPILER $[COMPILER] /NMttOn
  134. #define LINKER $[LINKER] /NMttOn
  135. #endif
  136. #elif $[eq $[USE_COMPILER], TRUETIME] // NuMega TrueTime Profiler
  137. // This may look like a bad thing (to extend the compiler
  138. // and linker with a switch), but I think it's the right
  139. // thing to do in this case -- skyler.
  140. #define COMPILER nmcl /NMttOn
  141. #define LINKER nmlink /NMttOn
  142. #define LIBBER lib
  143. #define COMMONFLAGS
  144. #define OPTFLAGS /O2 /Ogity /G6
  145. #define OPT1FLAGS /GZ
  146. #defer DEBUGFLAGS /MDd /Zi $[BROWSEINFO_FLAG] /Fd"$[osfilename $[target:%.obj=%.pdb]]"
  147. #define RELEASEFLAGS /MD
  148. #define EXTRA_LIBPATH
  149. #define EXTRA_INCPATH
  150. #else
  151. #error Invalid value specified for USE_COMPILER.
  152. #endif
  153. #if $[CHECK_SYNTAX_ONLY]
  154. #define END_CFLAGS $[END_CFLAGS] /Zs
  155. #endif
  156. #if $[GEN_ASSEMBLY]
  157. #define END_CFLAGS $[END_CFLAGS] /FAs
  158. #endif
  159. #if $[PREPROCESSOR_OUTPUT]
  160. #define END_CFLAGS $[END_CFLAGS] /E
  161. #endif