msvc_compiler.conf 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. CFLAGS_DEBUG = /Od /Ob0 /Oi
  27. CFLAGS_RELEASE = /O2 /Ob2 /Oi
  28. MASMFLAGS=
  29. _MASM_IO=/nologo /c /Fo${output;suf=${OBJECT_SUF}:SRC} ${input:SRC}
  30. when ($ARCH_ARMV7) {
  31. _MASM_IO=-o ${output;suf=${OBJECT_SUF}:SRC} ${input:SRC}
  32. }
  33. OBJ_CROSS_SUF=$OBJ_SUF
  34. OBJECT_SUF=$OBJ_SUF.obj
  35. CFLAGS+=$_MSVC_FLAGS $_MSVC_ONLY_FLAGS $CFLAGS_PER_TYPE $DEBUG_INFO_FLAGS $C_WARNING_OPTS $C_DEFINES $USER_CFLAGS $USER_CFLAGS_GLOBAL
  36. CXXFLAGS+=$CFLAGS $_STD_CXX $_CXX_FLAGS $_CXX_DEFINES $CXX_WARNING_OPTS $USER_CXXFLAGS $USER_CXXFLAGS_GLOBAL
  37. CONLYFLAGS+=$USER_CONLYFLAGS $USER_CONLYFLAGS_GLOBAL
  38. BC_CFLAGS+=$CFLAGS
  39. BC_CXXFLAGS+=$BC_CFLAGS $CXXFLAGS
  40. CFLAGS+=$_CFLAGS_UCRT_VC_INCLUDES
  41. when ($NO_WSHADOW == "yes") {
  42. C_WARNING_OPTS+=/wd4456 /wd4457
  43. }
  44. when ($NO_COMPILER_WARNINGS == "yes") {
  45. when ($CLANG_CL == "yes") {
  46. # Though /w is intended to switch off all the warnings,
  47. # it does not switch at least -Wregister and -Wreserved-user-defined-literal under clang-cl.
  48. #
  49. # Use -Wno-everything to force warning suppression.
  50. C_WARNING_OPTS = -Wno-everything
  51. CXX_WARNING_OPTS =
  52. }
  53. otherwise {
  54. C_WARNING_OPTS=/w
  55. CXX_WARNING_OPTS=
  56. }
  57. }
  58. when ($NO_OPTIMIZE == "yes") {
  59. OPTIMIZE=/Od
  60. }
  61. SFDL_FLAG=/E /C /P /TP /Fi$SFDL_TMP_OUT
  62. WERROR_FLAG=/WX
  63. CL_WRAPPER=${FIX_MSVC_OUTPUT} cl
  64. when ($_UNDER_WINE_COMPILER == "yes" || $CLANG_CL == "yes") {
  65. CL_WRAPPER=
  66. }
  67. ML_WRAPPER=${FIX_MSVC_OUTPUT} ml
  68. when ($_UNDER_WINE_TOOLS == "yes") {
  69. ML_WRAPPER=
  70. }
  71. _FORCE_CPP_FLAGS=/TP
  72. _C_CPP_KV_STYLE_P=p CC
  73. _C_CPP_KV_STYLE_PC=pc yellow
  74. _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"}
  75. _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}
  76. _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}
  77. _SRC_M_CMD=$_EMPTY_CMD
  78. _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"}