mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-06 17:13:49 +01: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:
@@ -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()
|
||||
|
||||
@@ -1343,6 +1343,7 @@ list( APPEND DEFINES PRIVATE "${export_symbol}" INTERFACE "${import_symbol}" )
|
||||
|
||||
target_sources( ${TARGET} PRIVATE ${HEADERS} ${SOURCES} ${RESOURCES} ${MAC_RESOURCES} ${WIN_RESOURCES} )
|
||||
target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} )
|
||||
target_compile_definitions( ${TARGET} PRIVATE ${CXX_WARNINGS_SILENCE_DEFINES})
|
||||
target_compile_options( ${TARGET} PRIVATE ${OPTIONS} )
|
||||
target_include_directories( ${TARGET} PRIVATE ${INCLUDES} )
|
||||
target_link_options( ${TARGET} PRIVATE ${LDFLAGS} )
|
||||
|
||||
Reference in New Issue
Block a user