msvc_compiler.conf 3.1 KB

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