CMake Build: Set /permissive- (standards conformance mode) for MSVC

To make errors appear faster when developing on Windows

MSVC 2017 and later have this flag to disallow MSVC-specific C++
language extensions. Use it to make code more correct and more portable.

Set this option with add_compile_options() in root CMakeLists.txt to
apply it to all targets.

Add one #include to unittest/gtest-clang-printing.cpp as workaround for
forward template declaration bug in MSVC http://tiny.cc/fa4tpz

Change-Id: Ie0b19701ad773c79ffd2fed24fffbb1dcb29538c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Volodymyr Zibarov
2020-05-26 11:16:26 +03:00
parent 93e7629ef6
commit 28a999be52
2 changed files with 6 additions and 0 deletions

View File

@@ -31,6 +31,7 @@
#include <clangdocumentsuspenderresumer.h>
#include <clangreferencescollector.h>
#include <filepathview.h>
#include <fulltokeninfo.h>
#include <tokenprocessor.h>