From a131689dc7757ba61d70686734b6511c636d1a5a Mon Sep 17 00:00:00 2001 From: kgv Date: Wed, 26 Jul 2017 18:44:20 +0300 Subject: [PATCH] 0028952: Configuration, CMake - define OCCT_NO_DEPRECATED while building OCCT by obsolete gcc versions --- adm/cmake/occt_toolkit.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/adm/cmake/occt_toolkit.cmake b/adm/cmake/occt_toolkit.cmake index 06901e9a21..a78c1aac87 100644 --- a/adm/cmake/occt_toolkit.cmake +++ b/adm/cmake/occt_toolkit.cmake @@ -287,6 +287,14 @@ if (BUILD_SHARED_LIBS) target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT}) endif() +# suppress deprecation warnings inside OCCT itself for old gcc versions with unavailable Standard_DISABLE_DEPRECATION_WARNINGS +if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6.0) + add_definitions("-DOCCT_NO_DEPRECATED") + message (STATUS "Warning: internal deprecation warnings by Standard_DEPRECATED have been disabled due to old gcc version being used") + endif() +endif() + # use Cotire to accelerate build via usage of precompiled headers if (BUILD_USE_PCH) if (WIN32)