compilerSettings.pp 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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 $[patsubst %.obj,%.pdb,$[target]]]"
  11. #defer DEBUGFLAGS /MDd $[BROWSEINFO_FLAG] $[DEBUGINFOFLAGS] $[DEBUGPDBFLAGS]
  12. #define RELEASEFLAGS /MD
  13. #define WARNING_LEVEL_FLAG /W3
  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. // ensure pdbs are copied to install dir
  35. #define build_pdbs yes
  36. #elif $[eq $[USE_COMPILER], MSVC7]
  37. #define COMPILER cl
  38. #define LINKER link
  39. #define LIBBER lib
  40. #if $[eq $[NO_CROSSOBJ_OPT],]
  41. #define DO_CROSSOBJ_OPT 1
  42. #endif
  43. #if $[DO_CROSSOBJ_OPT]
  44. #define OPT4FLAGS /GL
  45. #define LDFLAGS_OPT4 /LTCG
  46. #if $[>= $[OPTIMIZE],4]
  47. #define LIBBER $[LIBBER] /LTCG
  48. #endif
  49. #endif
  50. #define CDEFINES_OPT1
  51. #define CDEFINES_OPT2
  52. #define CDEFINES_OPT3
  53. #define CDEFINES_OPT4
  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 /RTCu because it crashes in dxgsg with internal compiler bug
  63. #define OPT1FLAGS /RTCs /GS
  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 $[patsubst %.obj,%.pdb,$[target]]]"
  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. // ensure pdbs are copied to install dir
  85. #define build_pdbs yes
  86. #elif $[eq $[USE_COMPILER], INTEL]
  87. #define COMPILER icl
  88. #define LINKER xilink
  89. #define LIBBER xilib
  90. #define COMMONFLAGS /DHAVE_DINKUM /Gi- /Qwd985 /Qvc7 /G6
  91. // Note: Zi cannot be used on multiproc builds with precomp hdrs, Z7 must be used instead
  92. #defer DEBUGPDBFLAGS /Zi /Qinline_debug_info /Fd"$[osfilename $[patsubst %.obj,%.pdb,$[target]]]"
  93. // Oy- needed for MS debugger
  94. #defer DEBUGFLAGS /Oy- /MDd $[BROWSEINFO_FLAG] $[DEBUGINFOFLAGS] $[DEBUGPDBFLAGS]
  95. #define RELEASEFLAGS /MD
  96. #define WARNING_LEVEL_FLAG /W3
  97. #if $[DO_CROSSOBJ_OPT]
  98. #define OPT4FLAGS /Qipo
  99. #define LDFLAGS_OPT4 /Qipo
  100. #endif
  101. // NODEFAULTLIB ensures static libs linked in will connect to the correct msvcrt, so no debug/release mixing occurs
  102. #define LDFLAGS_OPT1 /NODEFAULTLIB:MSVCRT.LIB
  103. #define LDFLAGS_OPT2 /NODEFAULTLIB:MSVCRT.LIB
  104. #define LDFLAGS_OPT3 /NODEFAULTLIB:MSVCRTD.LIB /OPT:REF
  105. #define LDFLAGS_OPT4 /NODEFAULTLIB:MSVCRTD.LIB /OPT:REF $[LDFLAGS_OPT4]
  106. // #define OPTFLAGS /O3 /Qipo /QaxW /Qvec_report1
  107. #define OPTFLAGS /O3 /Qip
  108. // use "unsafe" QIfist flt->int rounding only if FAST_FLT_TO_INT is defined
  109. #define OPTFLAGS $[OPTFLAGS] $[if $[ne $[FAST_FLT_TO_INT],], /QIfist,]
  110. #define OPT1FLAGS /GZ /Od
  111. // We assume the Intel compiler installation dir is mounted as /ia32.
  112. #define EXTRA_LIBPATH /ia32/lib
  113. #define EXTRA_INCPATH /ia32/include
  114. #if $[or $[ne $[FORCE_INLINING],],$[>= $[OPTIMIZE],2]]
  115. #define EXTRA_CDEFS FORCE_INLINING $[EXTRA_CDEFS]
  116. #endif
  117. // Note: all Opts will link w/debug info now
  118. #define LINKER_FLAGS /DEBUG /DEBUGTYPE:CV $[PROFILE_FLAG] /MAP $[MAPINFOFLAGS] /fixed:no /incremental:no
  119. // ensure pdbs are copied to install dir
  120. #define build_pdbs yes
  121. #elif $[eq $[USE_COMPILER], BOUNDS] // NuMega BoundsChecker
  122. #define COMPILER nmcl
  123. #define LINKER nmlink
  124. #define LIBBER lib
  125. #define COMMONFLAGS
  126. #define OPTFLAGS /O2 /Ogity /G6
  127. #define OPT1FLAGS /GZ
  128. #defer DEBUGPDBFLAGS /MDd /Zi $[BROWSEINFO_FLAG] /Fd"$[osfilename $[patsubst %.obj,%.pdb,$[target]]]"
  129. #define RELEASEFLAGS /MD
  130. #define EXTRA_LIBPATH
  131. #define EXTRA_INCPATH
  132. #if $[BOUNDS_TRUETIME] // NuMega BoundsChecker 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 $[COMPILER] /NMttOn
  137. #define LINKER $[LINKER] /NMttOn
  138. #endif
  139. #elif $[eq $[USE_COMPILER], TRUETIME] // NuMega TrueTime Profiler
  140. // This may look like a bad thing (to extend the compiler
  141. // and linker with a switch), but I think it's the right
  142. // thing to do in this case -- skyler.
  143. #define COMPILER nmcl /NMttOn
  144. #define LINKER nmlink /NMttOn
  145. #define LIBBER lib
  146. #define COMMONFLAGS
  147. #define OPTFLAGS /O2 /Ogity /G6
  148. #define OPT1FLAGS /GZ
  149. #defer DEBUGPDBFLAGS /MDd /Zi $[BROWSEINFO_FLAG] /Fd"$[osfilename $[patsubst %.obj,%.pdb,$[target]]]"
  150. #define RELEASEFLAGS /MD
  151. #define EXTRA_LIBPATH
  152. #define EXTRA_INCPATH
  153. #else
  154. #error Invalid value specified for USE_COMPILER.
  155. #endif
  156. #if $[CHECK_SYNTAX_ONLY]
  157. #define END_CFLAGS $[END_CFLAGS] /Zs
  158. #endif
  159. #if $[GEN_ASSEMBLY]
  160. #define END_CFLAGS $[END_CFLAGS] /FAs
  161. #endif
  162. #if $[PREPROCESSOR_OUTPUT]
  163. #define END_CFLAGS $[END_CFLAGS] /E
  164. #endif