diff --git a/cmake/modules/ErrorFlags.cmake b/cmake/modules/ErrorFlags.cmake index bc0d84bb1..836a4da26 100644 --- a/cmake/modules/ErrorFlags.cmake +++ b/cmake/modules/ErrorFlags.cmake @@ -44,9 +44,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") "-Werror" # Treat warnings as errors ) endif() - - set(SILENCE_DEPRECATION_DEFS "") - set(THIRD_PARTY_SILENCE_DEPRECATION_DEFS "") elseif(MSVC) set(COMPILE_ERROR_FLAGS "/W2" # Enable some warnings by default @@ -69,11 +66,9 @@ elseif(MSVC) ) endif() - set(SILENCE_DEPRECATION_DEFS "_SILENCE_CXX20_OLD_SHARED_PTR_ATOMIC_SUPPORT_DEPRECATION_WARNING") - set(THIRD_PARTY_SILENCE_DEPRECATION_DEFS "") + add_compile_definitions("_SILENCE_CXX20_OLD_SHARED_PTR_ATOMIC_SUPPORT_DEPRECATION_WARNING") endif() # Add the flags to the whole directory tree. We use the third-party flags for # targets whose SYSTEM property is true, and the normal flags otherwise. add_compile_options("$>,${THIRD_PARTY_COMPILE_ERROR_FLAGS},${COMPILE_ERROR_FLAGS}>") -add_compile_definitions("$>,${THIRD_PARTY_SILENCE_DEPRECATION_DEFS},${SILENCE_DEPRECATION_DEFS}>")