aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-03-23 23:33:14 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-03-23 23:33:14 +0300
commit9fd1ec230f6336ed5506d7e9053f957cb9cdd634 (patch)
treead92db4cc728ef0e9750622d53b727922d563920
parent8ffaaaaa865591e9f88ec0d20ddd518f4d2226c8 (diff)
downloadydb-9fd1ec230f6336ed5506d7e9053f957cb9cdd634.tar.gz
intermediate changes
ref:a9034aa2939a24aaea37c460a5a7ddbf6b1fe429
-rw-r--r--build/conf/compilers/msvc_compiler.conf52
-rwxr-xr-xbuild/ymake_conf.py40
2 files changed, 37 insertions, 55 deletions
diff --git a/build/conf/compilers/msvc_compiler.conf b/build/conf/compilers/msvc_compiler.conf
index a79f8928d8..a4b63fe521 100644
--- a/build/conf/compilers/msvc_compiler.conf
+++ b/build/conf/compilers/msvc_compiler.conf
@@ -58,33 +58,26 @@ _MSVC_WARNS_DISABLED+=/wd5033
_C_WARNINGS_CLANG_CL=
_CXX_WARNINGS_CLANG_CL=
-_CXX_WARNINGS_CLANG_CL_2019=
-_CXX_WARNINGS_CLANG_CL_2019_IDE_MSVS=
+_CXX_WARNINGS_CLANG_CL_IDE_MSVS=
when ($CLANG_CL == "yes") {
_C_WARNINGS_CLANG_CL=\
- -Wno-bitwise-op-parentheses \
-Wno-format \
- -Wno-logical-op-parentheses \
-Wno-parentheses \
-Wno-unknown-warning-option
_CXX_WARNINGS_CLANG_CL=\
- -Woverloaded-virtual \
-Wimport-preprocessor-directive-pedantic \
+ -Woverloaded-virtual \
+ -Wno-ambiguous-reversed-operator \
+ -Wno-defaulted-function-deleted \
+ -Wno-deprecated-anon-enum-enum-conversion \
+ -Wno-deprecated-enum-enum-conversion \
+ -Wno-deprecated-enum-float-conversion \
+ -Wno-deprecated-volatile \
-Wno-undefined-var-template
- when ($_TC_VERSION_AT_LEAST_2019 == "yes") {
- _CXX_WARNINGS_CLANG_CL_2019=\
- -Wno-deprecated-volatile \
- -Wno-deprecated-anon-enum-enum-conversion \
- -Wno-defaulted-function-deleted \
- -Wno-deprecated-enum-enum-conversion \
- -Wno-ambiguous-reversed-operator \
- -Wno-deprecated-enum-float-conversion
- }
-
when ($IDE_MSVS == "yes") {
- _CXX_WARNINGS_CLANG_CL_2019_IDE_MSVS=-Wno-unused-command-line-argument
+ _CXX_WARNINGS_CLANG_CL_IDE_MSVS=-Wno-unused-command-line-argument
}
}
@@ -95,8 +88,7 @@ _C_WARNINGS+=$_C_WARNINGS_CLANG_CL
_CXX_WARNINGS =
_CXX_WARNINGS+=$_CXX_WARNINGS_CLANG_CL
-_CXX_WARNINGS+=$_CXX_WARNINGS_CLANG_CL_2019
-_CXX_WARNINGS+=$_CXX_WARNINGS_CLANG_CL_2019_IDE_MSVS
+_CXX_WARNINGS+=$_CXX_WARNINGS_CLANG_CL_IDE_MSVS
_WINAPI_UNICODE=no
@@ -147,10 +139,16 @@ when ($CLANG_CL == "yes") {
# -fcase-insensitive-paths
# Allow <windows.h> to be included via <Windows.h> in case-sensitive file-systems.
#
- # -fno-common
- # Enable standard-conforming behavior and generate duplicate symbol error in case of duplicated global constants.
- # See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85678#c0
- _MSVC_FLAGS_CLANG=-fcase-insensitive-paths -fno-common
+ # -fms-compatibility-version
+ # At the time clang-cl identifies itself as MSVC 19.11:
+ # (actual value can be found in clang/lib/Driver/ToolChains/MSVC.cpp, the syntax would be like
+ # ```
+ # MSVT = VersionTuple(19, 11);
+ # ```
+ #
+ # We override this value to match current value of the actual MSVC being used.
+ #
+ _MSVC_FLAGS_CLANG=-fcase-insensitive-paths -fms-compatibility-version=19.21
when ($ARCH_X86_64 == "yes") {
_MSVC_FLAGS_CLANG_ARCH=-m64
}
@@ -161,16 +159,6 @@ when ($CLANG_CL == "yes") {
_MSVC_FLAGS_CLANG_ARCH=
}
- when ($_TC_VERSION_EXACTLY_2019 == "yes") {
- # heretic: на момент коммита в нашей конфигурации указано, что тулчейн clang11-windows - аналог msvc 2019
- # https://a.yandex-team.ru/arc/trunk/arcadia/build/ya.conf.json?rev=r7910792#L2185
- # сам clang11 по дефолту представляется msvc2017 (#define _MSC_VER 1911
- # https://a.yandex-team.ru/arc/trunk/arcadia/contrib/libs/clang11/lib/Driver/ToolChains/MSVC.cpp?rev=r7913127#L1352
- # вручную заставляем его представляться msvc2019 (#define _MSC_VER 1921)
- # значение версии взято вот отсюда:
- # https://a.yandex-team.ru/arc/trunk/arcadia/contrib/libs/llvm11/include/llvm/Support/Compiler.h?blame=true&rev=r7913127#L89
- _MSVC_FLAGS_CLANG_EQ_2019=-fms-compatibility-version=19.21
- }
}
_MSVC_FLAGS=/nologo /Zm500 /GR /bigobj /FC /EHs /errorReport:prompt $MSVC_INLINE_FLAG /utf-8
diff --git a/build/ymake_conf.py b/build/ymake_conf.py
index 01fb158d67..9518987e59 100755
--- a/build/ymake_conf.py
+++ b/build/ymake_conf.py
@@ -2460,44 +2460,38 @@ class MSVCCompiler(MSVC, Compiler):
flags += [
# Allow <windows.h> to be included via <Windows.h> in case-sensitive file-systems.
'-fcase-insensitive-paths',
+
+ # At the time clang-cl identifies itself as MSVC 19.11:
+ # (actual value can be found in clang/lib/Driver/ToolChains/MSVC.cpp, the syntax would be like
+ # ```
+ # MSVT = VersionTuple(19, 11);
+ # ```
+ #
+ # We override this value to match current value of the actual MSVC being used.
+ '-fms-compatibility-version=19.21',
]
if target.is_x86:
flags.append('-m32')
- if target.is_x86_64:
+ elif target.is_x86_64:
flags.append('-m64')
c_warnings.extend((
- '-Wno-bitwise-op-parentheses',
'-Wno-format',
- '-Wno-logical-op-parentheses',
'-Wno-parentheses',
'-Wno-unknown-warning-option',
))
cxx_warnings += [
- '-Woverloaded-virtual',
'-Wimport-preprocessor-directive-pedantic',
+ '-Woverloaded-virtual',
+ '-Wno-ambiguous-reversed-operator',
+ '-Wno-defaulted-function-deleted',
+ '-Wno-deprecated-anon-enum-enum-conversion',
+ '-Wno-deprecated-enum-enum-conversion',
+ '-Wno-deprecated-enum-float-conversion',
+ '-Wno-deprecated-volatile',
'-Wno-undefined-var-template',
]
- if self.tc.version_at_least(2019):
- cxx_warnings += [
- '-Wno-deprecated-volatile',
- '-Wno-deprecated-anon-enum-enum-conversion',
- '-Wno-defaulted-function-deleted',
- '-Wno-deprecated-enum-enum-conversion',
- '-Wno-ambiguous-reversed-operator',
- '-Wno-deprecated-enum-float-conversion',
- ]
-
- # heretic: на момент коммита в нашей конфигурации указано, что тулчейн clang11-windows - аналог msvc 2019
- # https://a.yandex-team.ru/arc/trunk/arcadia/build/ya.conf.json?rev=r7910792#L2185
- # сам clang11 по дефолту представляется msvc2017 (#define _MSC_VER 1911)
- # https://a.yandex-team.ru/arc/trunk/arcadia/contrib/libs/clang11/lib/Driver/ToolChains/MSVC.cpp?rev=r7913127#L1352
- # вручную заставляем его представляться msvc2019 (#define _MSC_VER 1921)
- # значение версии взято вот отсюда:
- # https://a.yandex-team.ru/arc/trunk/arcadia/contrib/libs/llvm11/include/llvm/Support/Compiler.h?blame=true&rev=r7913127#L89
- if self.tc.version_exactly(2019):
- flags.append('-fms-compatibility-version=19.21')
if self.tc.ide_msvs:
cxx_warnings += [