1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-19 17:11:12 +02:00

Add compile defintions to silence C++17 warnings

Add `CXX_WARNINGS_SILENCE_DEFINES` variable.

Signed-off-by: Emily Mabrey <emabrey@tenacityaudio.org>
Signed-off-by: Be <be@mixxx.org>
This commit is contained in:
Emily Mabrey
2021-08-14 16:18:06 -04:00
committed by Be
parent 76c63fa0fc
commit 86ef2cfc85
2 changed files with 7 additions and 0 deletions

View File

@@ -97,6 +97,11 @@ if( NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
set( CMAKE_BUILD_TYPE "Debug" )
endif()
# List of defines which are intended to silence C++17 warnings
# These will be added to each CMAKE target as PRIVATE compilation definitions
list( APPEND CXX_WARNINGS_SILENCE_DEFINES _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING=1 )
list( APPEND CXX_WARNINGS_SILENCE_DEFINES _SILENCE_CXX17_NEGATORS_DEPRECATION_WARNING=1 )
# Ignore COMPILE_DEFINITIONS_<Config> properties
cmake_policy( SET CMP0043 NEW )
@@ -699,6 +704,7 @@ if(NOT WIN32)
if(NOT TARGET wxWidgets::wxWidgets)
add_library(wxWidgets::wxWidgets INTERFACE IMPORTED)
target_link_libraries(wxWidgets::wxWidgets INTERFACE ${wxWidgets_LIBRARIES})
target_compile_definitions(wxWidgets::wxWidgets INTERFACE ${CXX_WARNINGS_SILENCE_DEFINES})
target_compile_definitions(wxWidgets::wxWidgets INTERFACE ${wxWidgets_DEFINITIONS} ${wxWidgets_DEFINITIONS_DEBUG})
endif()
else()