1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-31 03:12:44 +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:
Charles Kerr 2023-03-24 13:34:30 -05:00 committed by GitHub
parent 1b81883e66
commit 9fc0e4ff61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 11 deletions

View file

@ -56,6 +56,7 @@ option(ENABLE_WERROR "Treat warnings as errors" OFF)
option(ENABLE_NLS "Enable native language support" ON) option(ENABLE_NLS "Enable native language support" ON)
option(INSTALL_DOC "Build/install documentation" ON) option(INSTALL_DOC "Build/install documentation" ON)
option(INSTALL_LIB "Install the library" OFF) 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(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_EVENT2 "Use system event2 library" AUTO)
tr_auto_option(USE_SYSTEM_DEFLATE "Use system deflate 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}) target_include_directories(CURL::libcurl INTERFACE ${CURL_INCLUDE_DIRS})
endif() endif()
if(DISABLE_DEPRECATED STREQUAL "AUTO")
if(DEFINED ENV{CI})
set(DISABLE_DEPRECATED ON)
else()
set(DISABLE_DEPRECATED OFF)
endif()
endif()
set(CRYPTO_PKG "") set(CRYPTO_PKG "")
if(WITH_CRYPTO STREQUAL "AUTO" OR WITH_CRYPTO STREQUAL "ccrypto") if(WITH_CRYPTO STREQUAL "AUTO" OR WITH_CRYPTO STREQUAL "ccrypto")
tr_get_required_flag(WITH_CRYPTO CCRYPTO_IS_REQUIRED) tr_get_required_flag(WITH_CRYPTO CCRYPTO_IS_REQUIRED)

View file

@ -154,6 +154,16 @@ if(ENABLE_NLS)
${METAINFO_FILE}) ${METAINFO_FILE})
endif() endif()
target_compile_definitions(${TR_NAME}-gtk
PRIVATE
TRANSMISSIONLOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}"
GETTEXT_PACKAGE="${TR_NAME}-gtk"
# FIXME: these break libnotify's headers
# G_DISABLE_SINGLE_INCLUDES
# GTK_DISABLE_SINGLE_INCLUDES
$<$<BOOL:${ENABLE_UTP}>:WITH_UTP>)
if(DISABLE_DEPRECATED)
target_compile_definitions(${TR_NAME}-gtk target_compile_definitions(${TR_NAME}-gtk
PRIVATE PRIVATE
TRANSMISSIONLOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}" TRANSMISSIONLOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}"
@ -171,8 +181,8 @@ target_compile_definitions(${TR_NAME}-gtk
GLIBMM_DISABLE_DEPRECATED GLIBMM_DISABLE_DEPRECATED
GTKMM_DISABLE_DEPRECATED GTKMM_DISABLE_DEPRECATED
PANGOMM_DISABLE_DEPRECATED PANGOMM_DISABLE_DEPRECATED
SIGCXX_DISABLE_DEPRECATED SIGCXX_DISABLE_DEPRECATED)
$<$<BOOL:${ENABLE_UTP}>:WITH_UTP>) endif()
target_compile_options(${TR_NAME}-gtk target_compile_options(${TR_NAME}-gtk
PRIVATE PRIVATE