From 75a5ea01c19563ae1ba427e9206f2eae637d6070 Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Thu, 13 Feb 2020 17:13:07 -0700 Subject: Cleanup/MSVC: Enable C++ conformance mode on compiler versions that support it. MSVC has a conformance mode (/permissive-) where the C++ standard is more strictly enforced. This mode is available on MSVC 15.5+ [1] This patch enables this mode on compilers that support it and cleans up the few violations it threw up in the process. - Mantaflow was using M_PI without requesting them using the _USE_MATH_DEFINES define to opt in to non default behaviour. - Collada did not include the right header for std::cerr, this seemingly was fixed for other platforms already but put inside a platform guard. - Ghost had some scoping issues regarding uninitialized variables and goto behaviour Second landing of this patch, earlier commit was reverted due to some compiler configurations having slipped though testing [1] https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance Differential Revision: https://developer.blender.org/D6824 Reviewed By: brecht --- extern/mantaflow/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'extern/mantaflow') diff --git a/extern/mantaflow/CMakeLists.txt b/extern/mantaflow/CMakeLists.txt index d2f78f7ab6c..99d985578bd 100644 --- a/extern/mantaflow/CMakeLists.txt +++ b/extern/mantaflow/CMakeLists.txt @@ -54,6 +54,10 @@ if(WITH_OPENVDB) add_definitions(-DOPENVDB_STATICLIB) endif() +if(WIN32) + add_definitions(-D_USE_MATH_DEFINES) +endif() + set(INC ${MANTA_PP} ${MANTA_PP}/fileio -- cgit v1.2.3