mirror of
https://github.com/transmission/transmission
synced 2025-01-30 10:52:00 +00:00
fix: disable-deprecated by default for end users (#5289)
deprecations can be turned on manually and are auto-enabled in CI
This commit is contained in:
parent
1b81883e66
commit
9fc0e4ff61
2 changed files with 30 additions and 11 deletions
|
@ -56,6 +56,7 @@ option(ENABLE_WERROR "Treat warnings as errors" OFF)
|
|||
option(ENABLE_NLS "Enable native language support" ON)
|
||||
option(INSTALL_DOC "Build/install documentation" ON)
|
||||
option(INSTALL_LIB "Install the library" OFF)
|
||||
option(DISABLE_DEPRECATED "Set 'disable deprecated' option for upstream packages, e.g. GTK" AUTO)
|
||||
tr_auto_option(RUN_CLANG_TIDY "Run clang-tidy on the code" OFF)
|
||||
tr_auto_option(USE_SYSTEM_EVENT2 "Use system event2 library" AUTO)
|
||||
tr_auto_option(USE_SYSTEM_DEFLATE "Use system deflate library" AUTO)
|
||||
|
@ -215,6 +216,14 @@ if(NOT TARGET CURL::libcurl)
|
|||
target_include_directories(CURL::libcurl INTERFACE ${CURL_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
if(DISABLE_DEPRECATED STREQUAL "AUTO")
|
||||
if(DEFINED ENV{CI})
|
||||
set(DISABLE_DEPRECATED ON)
|
||||
else()
|
||||
set(DISABLE_DEPRECATED OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CRYPTO_PKG "")
|
||||
if(WITH_CRYPTO STREQUAL "AUTO" OR WITH_CRYPTO STREQUAL "ccrypto")
|
||||
tr_get_required_flag(WITH_CRYPTO CCRYPTO_IS_REQUIRED)
|
||||
|
|
|
@ -158,22 +158,32 @@ target_compile_definitions(${TR_NAME}-gtk
|
|||
PRIVATE
|
||||
TRANSMISSIONLOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}"
|
||||
GETTEXT_PACKAGE="${TR_NAME}-gtk"
|
||||
G_DISABLE_DEPRECATED
|
||||
GDK_PIXBUF_DISABLE_DEPRECATED
|
||||
GDK_DISABLE_DEPRECATED
|
||||
GTK_DISABLE_DEPRECATED
|
||||
PANGO_DISABLE_DEPRECATED
|
||||
# FIXME: these break libnotify's headers
|
||||
# G_DISABLE_SINGLE_INCLUDES
|
||||
# GTK_DISABLE_SINGLE_INCLUDES
|
||||
GDKMM_DISABLE_DEPRECATED
|
||||
GIOMM_DISABLE_DEPRECATED
|
||||
GLIBMM_DISABLE_DEPRECATED
|
||||
GTKMM_DISABLE_DEPRECATED
|
||||
PANGOMM_DISABLE_DEPRECATED
|
||||
SIGCXX_DISABLE_DEPRECATED
|
||||
$<$<BOOL:${ENABLE_UTP}>:WITH_UTP>)
|
||||
|
||||
if(DISABLE_DEPRECATED)
|
||||
target_compile_definitions(${TR_NAME}-gtk
|
||||
PRIVATE
|
||||
TRANSMISSIONLOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}"
|
||||
GETTEXT_PACKAGE="${TR_NAME}-gtk"
|
||||
G_DISABLE_DEPRECATED
|
||||
GDK_PIXBUF_DISABLE_DEPRECATED
|
||||
GDK_DISABLE_DEPRECATED
|
||||
GTK_DISABLE_DEPRECATED
|
||||
PANGO_DISABLE_DEPRECATED
|
||||
# FIXME: these break libnotify's headers
|
||||
# G_DISABLE_SINGLE_INCLUDES
|
||||
# GTK_DISABLE_SINGLE_INCLUDES
|
||||
GDKMM_DISABLE_DEPRECATED
|
||||
GIOMM_DISABLE_DEPRECATED
|
||||
GLIBMM_DISABLE_DEPRECATED
|
||||
GTKMM_DISABLE_DEPRECATED
|
||||
PANGOMM_DISABLE_DEPRECATED
|
||||
SIGCXX_DISABLE_DEPRECATED)
|
||||
endif()
|
||||
|
||||
target_compile_options(${TR_NAME}-gtk
|
||||
PRIVATE
|
||||
$<$<BOOL:${ENABLE_WERROR}>:$<IF:$<CXX_COMPILER_ID:MSVC>,/WX,-Werror>>
|
||||
|
|
Loading…
Reference in a new issue