Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Meel <ankitjmeel@gmail.com>2021-08-21 11:32:50 +0300
committerAnkit Meel <ankitjmeel@gmail.com>2021-08-21 11:32:50 +0300
commit34a05f39be2b79dd1c508c374a47cee6792174f9 (patch)
treedcd3eda7093ac282004db802dc731c2aca53333c
parent0b7947e85528bbf5c4e1f41354a41dc113937088 (diff)
Clang: warn about C++20 designated initializers
With the ongoing transition to C++ files, Windows build breaks often because of designated initializers. Now we have two compilers to catch the MSVC build error on. Reviewed By: #platform_macos, brecht, campbellbarton Differential Revision: https://developer.blender.org/D11940
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2868324bf46..5a555876d21 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1598,6 +1598,10 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_PARAMETER -Wunused-parameter)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
+ # Designated initializer is a C++20 feature & breaks MSVC build. Dropping MSVC 2019 or
+ # updating to C++20 allows removing this.
+ ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_CXX20_DESIGNATOR -Wc++20-designator)
+
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_AUTOLOGICAL_COMPARE -Wno-tautological-compare)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts)