msvc_compiler.conf 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. _STD_CXX=/std:$_STD_CXX_VERSION
  2. C_COMPILER=${_WINE_C_PREFIX} ${C_COMPILER_UNQUOTED}
  3. CXX_COMPILER=${_WINE_CXX_PREFIX} ${CXX_COMPILER_UNQUOTED}
  4. CXX_COMPILER_OLD=${_WINE_CXX_PREFIX} ${quo:CXX_COMPILER_OLD_UNQUOTED}
  5. MASM_COMPILER=${_WINE_MASM_PREFIX} ${MASM_COMPILER_UNQUOTED}
  6. MASM_COMPILER_OLD=${_WINE_MASM_PREFIX} ${quo:MASM_COMPILER_OLD_UNQUOTED}
  7. MSVC_INLINE_OPTIMIZED=yes
  8. when ($MSVC_INLINE_OPTIMIZED == "yes") {
  9. MSVC_INLINE_FLAG=/Zc:inline
  10. }
  11. when ($MSVC_INLINE_OPTIMIZED == "no") {
  12. MSVC_INLINE_FLAG=/Zc:inline-
  13. }
  14. # Provide proper __cplusplus value
  15. # https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
  16. _CXX_FLAGS=/Zc:__cplusplus
  17. _MSVC_ONLY_FLAGS=
  18. DEBUG_INFO_FLAGS=/Z7
  19. when ($IDE_MSVS == "yes") {
  20. when ($CLANG_CL != "yes") {
  21. _MSVC_ONLY_FLAGS=/FD /MP
  22. }
  23. DEBUG_INFO_FLAGS=/Zi /FS
  24. }
  25. CFLAGS_DEBUG = /Od /Ob0 /Oi
  26. CFLAGS_RELEASE = /O2 /Ob2 /Oi
  27. MASMFLAGS=
  28. _MASM_IO=/nologo /c /Fo${output;suf=${OBJECT_SUF}:SRC} ${input:SRC}
  29. when ($ARCH_ARMV7) {
  30. _MASM_IO=-o ${output;suf=${OBJECT_SUF}:SRC} ${input:SRC}
  31. }
  32. OBJ_CROSS_SUF=$OBJ_SUF
  33. OBJECT_SUF=$OBJ_SUF.obj
  34. CFLAGS+=$_MSVC_FLAGS $_MSVC_ONLY_FLAGS $CFLAGS_PER_TYPE $DEBUG_INFO_FLAGS $C_WARNING_OPTS $C_DEFINES $USER_CFLAGS $USER_CFLAGS_GLOBAL
  35. CXXFLAGS+=$CFLAGS $_STD_CXX $_CXX_FLAGS $_CXX_DEFINES $CXX_WARNING_OPTS $USER_CXXFLAGS $USER_CXXFLAGS_GLOBAL
  36. CONLYFLAGS+=$USER_CONLYFLAGS $USER_CONLYFLAGS_GLOBAL
  37. BC_CFLAGS+=$CFLAGS
  38. BC_CXXFLAGS+=$BC_CFLAGS $CXXFLAGS
  39. CFLAGS+=$_CFLAGS_UCRT_VC_INCLUDES
  40. when ($NO_WSHADOW == "yes") {
  41. C_WARNING_OPTS+=/wd4456 /wd4457
  42. }
  43. when ($NO_COMPILER_WARNINGS == "yes") {
  44. when ($CLANG_CL == "yes") {
  45. # Though /w is intended to switch off all the warnings,
  46. # it does not switch at least -Wregister and -Wreserved-user-defined-literal under clang-cl.
  47. #
  48. # Use -Wno-everything to force warning suppression.
  49. C_WARNING_OPTS = -Wno-everything
  50. CXX_WARNING_OPTS =
  51. }
  52. otherwise {
  53. C_WARNING_OPTS=/w
  54. CXX_WARNING_OPTS=
  55. }
  56. }
  57. when ($NO_OPTIMIZE == "yes") {
  58. OPTIMIZE=/Od
  59. }
  60. SFDL_FLAG=/E /C /P /TP /Fi$SFDL_TMP_OUT
  61. WERROR_FLAG=/WX
  62. CL_WRAPPER=${FIX_MSVC_OUTPUT} cl
  63. when ($_UNDER_WINE_COMPILER == "yes" || $CLANG_CL == "yes") {
  64. CL_WRAPPER=
  65. }
  66. ML_WRAPPER=${FIX_MSVC_OUTPUT} ml
  67. when ($_UNDER_WINE_TOOLS == "yes") {
  68. ML_WRAPPER=
  69. }
  70. _FORCE_CPP_FLAGS=/TP
  71. _C_CPP_KV_STYLE_P=p CC
  72. _C_CPP_KV_STYLE_PC=pc yellow
  73. _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"}
  74. _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}
  75. _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}
  76. _SRC_M_CMD=$_EMPTY_CMD
  77. _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"}