compilerSettings.pp 6.7 KB

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