diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 6e55c3c9a22..0f9d677a193 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -652,6 +652,25 @@ macro(add_cxx_flag string(APPEND CMAKE_CXX_FLAGS " ${flag}") endmacro() +# Needed to "negate" options: `-Wno-example` +# as this doesn't work when added to `CMAKE_CXX_FLAGS`. +macro(add_c_flag_per_config + flag) + + string(APPEND CMAKE_C_FLAGS_DEBUG " ${flag}") + string(APPEND CMAKE_C_FLAGS_RELEASE " ${flag}") + string(APPEND CMAKE_C_FLAGS_MINSIZEREL " ${flag}") + string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO " ${flag}") +endmacro() +macro(add_cxx_flag_per_config + flag) + + string(APPEND CMAKE_CXX_FLAGS_DEBUG " ${flag}") + string(APPEND CMAKE_CXX_FLAGS_RELEASE " ${flag}") + string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL " ${flag}") + string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " ${flag}") +endmacro() + macro(remove_strict_flags) if(CMAKE_COMPILER_IS_GNUCC) diff --git a/intern/libmv/CMakeLists.txt b/intern/libmv/CMakeLists.txt index e15b8d5697d..fc63b4d73fd 100644 --- a/intern/libmv/CMakeLists.txt +++ b/intern/libmv/CMakeLists.txt @@ -6,6 +6,12 @@ # If you're doing changes in this file, please update template # in that script too +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # Suppress these warnings until the issue is addressed as this adds noise. + # Use `-Wno-deprecated-copy` as this may have been enabled via `-Wextra`. + add_cxx_flag_per_config("-Wno-deprecated-copy") +endif() + set(INC . ) diff --git a/intern/libmv/bundle.sh b/intern/libmv/bundle.sh index 45c5bd1888e..66783febcb5 100755 --- a/intern/libmv/bundle.sh +++ b/intern/libmv/bundle.sh @@ -89,6 +89,12 @@ cat > CMakeLists.txt << EOF # If you're doing changes in this file, please update template # in that script too +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # Suppress these warnings until the issue is addressed as this adds noise. + # Use `-Wno-deprecated-copy` as this may have been enabled via `-Wextra`. + add_cxx_flag_per_config("-Wno-deprecated-copy") +endif() + set(INC . ) diff --git a/source/blender/ikplugin/intern/itasc_plugin.cc b/source/blender/ikplugin/intern/itasc_plugin.cc index 59ef62e9725..1ff416cb6db 100644 --- a/source/blender/ikplugin/intern/itasc_plugin.cc +++ b/source/blender/ikplugin/intern/itasc_plugin.cc @@ -12,6 +12,12 @@ #include #include +/* Already suppressed in `intern/itasc/CMakeLists.txt` however that doesn't apply here. */ +#if defined(__GNUC__) && !defined(__clang__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wdeprecated-copy" +#endif + /* iTaSC headers */ #ifdef WITH_IK_ITASC # include "Armature.hpp" @@ -24,6 +30,10 @@ # include "WSDLSSolver.hpp" #endif +#if defined(__GNUC__) && !defined(__clang__) +# pragma GCC diagnostic pop +#endif + #include "MEM_guardedalloc.h" #include "BIK_api.h"