msvc_compiler.conf 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. _STD_CXX=/std:$_STD_CXX_VERSION
  2. C_COMPILER=${_WINE_C_PREFIX} ${C_COMPILER_UNQUOTED}
  3. C_COMPILER_OLD=${_WINE_C_PREFIX} ${quo:C_COMPILER_OLD_UNQUOTED}
  4. CXX_COMPILER=${_WINE_CXX_PREFIX} ${CXX_COMPILER_UNQUOTED}
  5. CXX_COMPILER_OLD=${_WINE_CXX_PREFIX} ${quo:CXX_COMPILER_OLD_UNQUOTED}
  6. MASM_COMPILER=${_WINE_MASM_PREFIX} ${MASM_COMPILER_UNQUOTED}
  7. MASM_COMPILER_OLD=${_WINE_MASM_PREFIX} ${quo:MASM_COMPILER_OLD_UNQUOTED}
  8. MSVC_INLINE_OPTIMIZED=yes
  9. when ($MSVC_INLINE_OPTIMIZED == "yes") {
  10. MSVC_INLINE_FLAG=/Zc:inline
  11. }
  12. when ($MSVC_INLINE_OPTIMIZED == "no") {
  13. MSVC_INLINE_FLAG=/Zc:inline-
  14. }
  15. # Provide proper __cplusplus value
  16. # https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
  17. _CXX_FLAGS=/Zc:__cplusplus
  18. _MSVC_ONLY_FLAGS=
  19. DEBUG_INFO_FLAGS=/Z7
  20. when ($IDE_MSVS == "yes") {
  21. when ($CLANG_CL != "yes") {
  22. _MSVC_ONLY_FLAGS=/FD /MP
  23. }
  24. DEBUG_INFO_FLAGS=/Zi /FS
  25. }
  26. # https://msdn.microsoft.com/en-us/library/abx4dbyh.aspx
  27. when ($DLL_RUNTIME == "yes") {
  28. _FLAGS_DEBUG_RUNTIME=/MDd
  29. _FLAGS_RELEASE_RUNTIME=/MD
  30. }
  31. otherwise {
  32. _FLAGS_DEBUG_RUNTIME=/MTd
  33. _FLAGS_RELEASE_RUNTIME=/MT
  34. }
  35. CFLAGS_DEBUG = /Od /Ob0 /Oi /D_DEBUG $_FLAGS_DEBUG_RUNTIME
  36. CFLAGS_RELEASE = /O2 /Ob2 /Oi /DNDEBUG $_FLAGS_RELEASE_RUNTIME
  37. MASMFLAGS=
  38. _MASM_IO=/nologo /c /Fo${output;suf=${OBJECT_SUF}:SRC} ${input:SRC}
  39. when ($ARCH_ARMV7) {
  40. _MASM_IO=-o ${output;suf=${OBJECT_SUF}:SRC} ${input:SRC}
  41. }
  42. OBJ_CROSS_SUF=$OBJ_SUF
  43. OBJECT_SUF=$OBJ_SUF.obj
  44. CFLAGS+=$_MSVC_FLAGS $_MSVC_ONLY_FLAGS $CFLAGS_PER_TYPE $DEBUG_INFO_FLAGS $C_WARNING_OPTS $C_DEFINES $USER_CFLAGS $USER_CFLAGS_GLOBAL
  45. CXXFLAGS+=$CFLAGS $_STD_CXX $_CXX_FLAGS $_CXX_DEFINES $CXX_WARNING_OPTS $USER_CXXFLAGS $USER_CXXFLAGS_GLOBAL
  46. CONLYFLAGS+=$USER_CONLYFLAGS $USER_CONLYFLAGS_GLOBAL
  47. BC_CFLAGS+=$CFLAGS
  48. BC_CXXFLAGS+=$BC_CFLAGS $CXXFLAGS
  49. CFLAGS+=$_CFLAGS_UCRT_VC_INCLUDES
  50. when ($NO_WSHADOW == "yes") {
  51. C_WARNING_OPTS+=/wd4456 /wd4457
  52. }
  53. when ($NO_COMPILER_WARNINGS == "yes") {
  54. when ($CLANG_CL == "yes") {
  55. # Though /w is intended to switch off all the warnings,
  56. # it does not switch at least -Wregister and -Wreserved-user-defined-literal under clang-cl.
  57. #
  58. # Use -Wno-everything to force warning suppression.
  59. C_WARNING_OPTS = -Wno-everything
  60. CXX_WARNING_OPTS =
  61. }
  62. otherwise {
  63. C_WARNING_OPTS=/w
  64. CXX_WARNING_OPTS=
  65. }
  66. }
  67. when ($NO_OPTIMIZE == "yes") {
  68. OPTIMIZE=/Od
  69. }
  70. SFDL_FLAG=/E /C /P /TP /Fi$SFDL_TMP_OUT
  71. WERROR_FLAG=/WX
  72. CL_WRAPPER=${FIX_MSVC_OUTPUT} cl
  73. when ($_UNDER_WINE_COMPILER == "yes" || $CLANG_CL == "yes") {
  74. CL_WRAPPER=
  75. }
  76. ML_WRAPPER=${FIX_MSVC_OUTPUT} ml
  77. when ($_UNDER_WINE_TOOLS == "yes") {
  78. ML_WRAPPER=
  79. }
  80. _FORCE_CPP_FLAGS=/TP
  81. _C_CPP_KV_STYLE_P=p CC
  82. _C_CPP_KV_STYLE_PC=pc yellow
  83. _SRC_C_NODEPS_CMD=${TOOLCHAIN_ENV} ${CL_WRAPPER} ${C_COMPILER} /c /Fo${OUTFILE} ${SRC} ${EXTRA_C_FLAGS} ${pre=/I :INC} ${CFLAGS} ${hide;kv:"soe"} ${hide;kv:"p CC"} ${hide;kv:"pc yellow"}
  84. _SRC_CPP_CMD=${TOOLCHAIN_ENV} ${CL_WRAPPER} ${CXX_COMPILER_OLD} /c /Fo$_COMPILE_OUTPUTS ${input:SRC} ${EXTRA_C_FLAGS} ${pre=/I :_C__INCLUDE} ${CXXFLAGS} ${SRCFLAGS} ${_LANG_CFLAGS_VALUE} ${hide;kv:"soe"} ${hide;kv:"p CC"} ${hide;kv:"pc yellow"}
  85. _SRC_CPP_CMD_NEW=${TOOLCHAIN_ENV} ${CL_WRAPPER} ${CXX_COMPILER} /c /Fo$_COMPILE_OUTPUTS ${input:SRC} ${EXTRA_C_FLAGS} ${pre=/I :_C__INCLUDE} ${CXXFLAGS} ${SRCFLAGS} ${_LANG_CFLAGS_VALUE_NEW} ${hide;kv:"soe"} ${hide;kv:_C_CPP_KV_STYLE_P} ${hide;kv:_C_CPP_KV_STYLE_PC}
  86. _SRC_CPP_CMD_NEW_FORCED=${TOOLCHAIN_ENV} ${CL_WRAPPER} ${CXX_COMPILER} /c /Fo$_COMPILE_OUTPUTS ${input:SRC} ${EXTRA_C_FLAGS} ${pre=/I :_C__INCLUDE} ${CXXFLAGS} $_FORCE_CPP_FLAGS ${SRCFLAGS} ${_LANG_CFLAGS_VALUE_NEW} ${hide;kv:"soe"} ${hide;kv:_C_CPP_KV_STYLE_P} ${hide;kv:_C_CPP_KV_STYLE_PC}
  87. _SRC_C_CMD=${TOOLCHAIN_ENV} ${CL_WRAPPER} ${C_COMPILER_OLD} /c /Fo$_COMPILE_OUTPUTS ${input:SRC} ${EXTRA_C_FLAGS} ${pre=/I :_C__INCLUDE} ${CFLAGS} ${CONLYFLAGS} ${SRCFLAGS} ${hide;kv:"soe"} ${hide;kv:"p CC"} ${hide;kv:"pc yellow"}
  88. _SRC_C_CMD_NEW=${TOOLCHAIN_ENV} ${CL_WRAPPER} ${C_COMPILER} /c /Fo$_COMPILE_OUTPUTS ${input:SRC} ${EXTRA_C_FLAGS} ${pre=/I :_C__INCLUDE} ${CFLAGS} ${CONLYFLAGS} ${SRCFLAGS} ${hide;kv:"soe"} ${hide;kv:_C_CPP_KV_STYLE_P} ${hide;kv:_C_CPP_KV_STYLE_PC}
  89. _SRC_M_CMD=$_EMPTY_CMD
  90. _SRC_MASM_CMD=${cwd:ARCADIA_BUILD_ROOT} ${TOOLCHAIN_ENV} ${ML_WRAPPER} ${MASM_COMPILER_OLD} ${MASMFLAGS} ${SRCFLAGS} $_MASM_IO ${hide;kv:"p AS"} ${hide;kv:"pc yellow"}