From bcb7b119ae5240632b7f8b07f926c230f3c48daf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 26 Sep 2022 12:26:48 +1000 Subject: Cleanup: remove workarounds and version checks for unsupported compilers Match minimum supported versions from the WIKI [0] by raising them to: - GCC 9.3.1 - CLANG 8.0 - MVCS 2019 (16.9.16 / 1928) Details: - Add CMake checks that ensure supported compiler versions early on. - Previously GCC per-processor version checks served to exclude `__clang__`, in some cases this has been replaced by explicitly excluding `__clang__`. This was needed as CLANG treated some of these flags differently to GCC, causing the build to fail. - Remove USE_APPLE_OMP_FIX GCC-4.2 OpenMP workaround. - Remove linking error workaround for old MSVC versions. [0]: https://wiki.blender.org/wiki/Building_Blender Reviewed by: brecht, LazyDodo Ref D16068 --- intern/atomic/intern/atomic_ops_utils.h | 3 +-- intern/atomic/tests/atomic_test.cc | 8 ++------ 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'intern/atomic') diff --git a/intern/atomic/intern/atomic_ops_utils.h b/intern/atomic/intern/atomic_ops_utils.h index 533cfbe9e1f..1c4cef564c3 100644 --- a/intern/atomic/intern/atomic_ops_utils.h +++ b/intern/atomic/intern/atomic_ops_utils.h @@ -106,8 +106,7 @@ /* Copied from BLI_utils... */ /* C++ can't use _Static_assert, expects static_assert() but c++0x only, * Coverity also errors out. */ -#if (!defined(__cplusplus)) && (!defined(__COVERITY__)) && \ - (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 406)) /* gcc4.6+ only */ +#if (!defined(__cplusplus)) && (!defined(__COVERITY__)) && (defined(__GNUC__)) /* GCC only. */ # define ATOMIC_STATIC_ASSERT(a, msg) __extension__ _Static_assert(a, msg); #else /* Code adapted from http://www.pixelbeat.org/programming/gcc/static_assert.html */ diff --git a/intern/atomic/tests/atomic_test.cc b/intern/atomic/tests/atomic_test.cc index 37a66cf0e9c..6c0e96b9d91 100644 --- a/intern/atomic/tests/atomic_test.cc +++ b/intern/atomic/tests/atomic_test.cc @@ -6,12 +6,8 @@ #include "testing/testing.h" #ifdef __GNUC__ -# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 /* gcc4.6+ only */ -# pragma GCC diagnostic error "-Wsign-compare" -# endif -# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 -# pragma GCC diagnostic error "-Wsign-conversion" -# endif +# pragma GCC diagnostic error "-Wsign-compare" +# pragma GCC diagnostic error "-Wsign-conversion" #endif /* -------------------------------------------------------------------- */ -- cgit v1.2.3