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:
authorSybren A. Stüvel <sybren>2020-08-20 11:19:52 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-08-20 17:12:28 +0300
commit948e080fc5bb501f5fde183c3d5f52c3ca797190 (patch)
tree4a6fa772a44457c4e62502cb8e12d722511bb684 /build_files/cmake
parent7fac0f9cd5a2422f57ceab255389ed2954508131 (diff)
Silence `-Wmaybe-uninitialized` warning on GCC/Linux
Add `-Wno-maybe-uninitialized` option to `CMAKE_CXX_FLAGS_RELEASE` and `CMAKE_CXX_FLAGS_RELWITHDEBINFO` variables on GCC/Linux. In Release builds GCC's `-Wmaybe-uninitialized` warning is unreliable, and thus causes noise that can drown out other warnings. These warnings are now silenced in release mode builds.a Debug builds seem fine, so flags for debug builds are not touched by this commit. No functional changes. Reviewed By: Sergey Differential Revision: https://developer.blender.org/D8615
Diffstat (limited to 'build_files/cmake')
-rw-r--r--build_files/cmake/platform/platform_unix.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
index 83909a0cf66..0ef180435b3 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -590,6 +590,14 @@ endif()
if(CMAKE_COMPILER_IS_GNUCC)
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
+ # `maybe-uninitialized` is unreliable in release builds, but fine in debug builds.
+ set(GCC_EXTRA_FLAGS_RELEASE "-Wno-maybe-uninitialized")
+ set(CMAKE_C_FLAGS_RELEASE "${GCC_EXTRA_FLAGS_RELEASE} ${CMAKE_C_FLAGS_RELEASE}")
+ set(CMAKE_C_FLAGS_RELWITHDEBINFO "${GCC_EXTRA_FLAGS_RELEASE} ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
+ set(CMAKE_CXX_FLAGS_RELEASE "${GCC_EXTRA_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELEASE}")
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${GCC_EXTRA_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
+ unset(GCC_EXTRA_FLAGS_RELEASE)
+
if(WITH_LINKER_GOLD)
execute_process(
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version