aboutsummaryrefslogtreecommitdiffstats
path: root/build/conf/compilers/msvc_compiler.conf
diff options
context:
space:
mode:
authoralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
committeralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
commitbf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch)
tree1d1df72c0541a59a81439842f46d95396d3e7189 /build/conf/compilers/msvc_compiler.conf
parent8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff)
downloadydb-bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0.tar.gz
add ymake export to ydb
Diffstat (limited to 'build/conf/compilers/msvc_compiler.conf')
-rw-r--r--build/conf/compilers/msvc_compiler.conf90
1 files changed, 90 insertions, 0 deletions
diff --git a/build/conf/compilers/msvc_compiler.conf b/build/conf/compilers/msvc_compiler.conf
new file mode 100644
index 0000000000..a509b02348
--- /dev/null
+++ b/build/conf/compilers/msvc_compiler.conf
@@ -0,0 +1,90 @@
+MSVC_INLINE_OPTIMIZED=yes
+when ($MSVC_INLINE_OPTIMIZED == "yes") {
+ MSVC_INLINE_FLAG=/Zc:inline
+}
+when ($MSVC_INLINE_OPTIMIZED == "no") {
+ MSVC_INLINE_FLAG=/Zc:inline-
+}
+
+# Provide proper __cplusplus value
+# https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
+_CXX_FLAGS=/Zc:__cplusplus
+
+_MSVC_ONLY_FLAGS=
+DEBUG_INFO_FLAGS=/Z7
+when ($IDE_MSVS == "yes") {
+ when ($CLANG_CL != "yes") {
+ _MSVC_ONLY_FLAGS=/FD /MP
+ }
+ DEBUG_INFO_FLAGS=/Zi /FS
+}
+
+# https://msdn.microsoft.com/en-us/library/abx4dbyh.aspx
+when ($DLL_RUNTIME == "yes") {
+ _FLAGS_DEBUG_RUNTIME=/MDd
+ _FLAGS_RELEASE_RUNTIME=/MD
+}
+otherwise {
+ _FLAGS_DEBUG_RUNTIME=/MTd
+ _FLAGS_RELEASE_RUNTIME=/MT
+}
+CFLAGS_DEBUG=/Ob0 /Od /D_DEBUG $_FLAGS_DEBUG_RUNTIME
+CFLAGS_RELEASE=/Ox /Ob2 /Oi /DNDEBUG $_FLAGS_RELEASE_RUNTIME
+
+MASMFLAGS=
+_MASM_IO=/nologo /c /Fo${output;suf=${OBJECT_SUF}:SRC} ${input;msvs_source:SRC}
+when ($ARCH_ARMV7) {
+ _MASM_IO=-o ${output;suf=${OBJECT_SUF}:SRC} ${input;msvs_source:SRC}
+}
+
+OBJ_CROSS_SUF=$OBJ_SUF
+OBJECT_SUF=$OBJ_SUF.obj
+
+CFLAGS+=$_MSVC_FLAGS $_MSVC_ONLY_FLAGS $CFLAGS_PER_TYPE $DEBUG_INFO_FLAGS $C_WARNING_OPTS $C_DEFINES $USER_CFLAGS $USER_CFLAGS_GLOBAL
+CXXFLAGS+=$CFLAGS $_STD_CXX $_CXX_FLAGS $_CXX_DEFINES $CXX_WARNING_OPTS $USER_CXXFLAGS $USER_CXXFLAGS_GLOBAL
+CONLYFLAGS+=$USER_CONLYFLAGS $USER_CONLYFLAGS_GLOBAL
+
+BC_CFLAGS+=$CFLAGS
+BC_CXXFLAGS+=$BC_CFLAGS $CXXFLAGS
+
+CFLAGS+=$_CFLAGS_UCRT_VC_INCLUDES
+
+when ($NO_WSHADOW == "yes") {
+ C_WARNING_OPTS+=/wd4456 /wd4457
+}
+
+when ($NO_COMPILER_WARNINGS == "yes") {
+ C_WARNING_OPTS=/w
+ when ($CLANG_CL == "yes") {
+ # Though /w is intended to switch off all the warnings,
+ # it does not switch at least -Wregister and -Wreserved-user-defined-literal under clang-cl.
+ #
+ # Use -Wno-everything to force warning suppression.
+ CXX_WARNING_OPTS=-Wno-everything
+ }
+ otherwise {
+ CXX_WARNING_OPTS=
+ }
+}
+
+when ($NO_OPTIMIZE == "yes") {
+ OPTIMIZE=/Od
+}
+
+SFDL_FLAG=/E /C /P /TP /Fi$SFDL_TMP_OUT
+WERROR_FLAG=/WX
+
+CL_WRAPPER=${FIX_MSVC_OUTPUT} cl
+ML_WRAPPER=${FIX_MSVC_OUTPUT} ml
+when ($_UNDER_WINE == "yes" && $CLANG_CL !="yes") {
+ CL_WRAPPER=
+ ML_WRAPPER=
+}
+
+_FORCE_CPP_FLAGS=/TP
+
+_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"}
+_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"}
+_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"}
+_SRC_M_CMD=$_EMPTY_CMD
+_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"}