mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Warn about deprecated gtk, glib
- G_DISABLE_DEPRECATED no longer exists (as of glib 2.61.2) - Turn off aqbanking global deprecation Spoilers: - gtk - (3.22) gdk_screen_width - (3.22) gdk_screen_height - glib - (2.68) g_binding_get_target -> g_binding_dup_target - aqbanking - AB_Banking_LoadSharedConfig
This commit is contained in:
@@ -52,8 +52,8 @@ option (WITH_OFX "compile with ofx support (needs LibOFX)" ON)
|
||||
option (WITH_PYTHON "enable python plugin and bindings" OFF)
|
||||
option (ENABLE_BINRELOC "compile with binary relocation support" ON)
|
||||
option (DISABLE_NLS "do not use Native Language Support" OFF)
|
||||
option (DISABLE_DEPRECATED_GLIB "don't use deprecated glib functions" OFF)
|
||||
option (DISABLE_DEPRECATED_GTK "don't use deprecated gtk, gdk or gdk-pixbuf functions" OFF)
|
||||
option (WARN_DEPRECATED_GLIB "warn about deprecated glib functions" OFF)
|
||||
option (WARN_DEPRECATED_GTK "warn about deprecated gtk, gdk or gdk-pixbuf functions" OFF)
|
||||
# ############################################################
|
||||
|
||||
# These are also settable from the command line in a similar way.
|
||||
@@ -196,7 +196,10 @@ if (NOT PKG_CONFIG_FOUND)
|
||||
endif()
|
||||
|
||||
# glib et al.
|
||||
pkg_check_modules (GLIB2 REQUIRED IMPORTED_TARGET glib-2.0>=2.56.1)
|
||||
set(GLIB_MIN_VERSION 2.56.1)
|
||||
set(GTK_MIN_VERSION 3.22.30)
|
||||
|
||||
pkg_check_modules (GLIB2 REQUIRED IMPORTED_TARGET glib-2.0>=${GLIB_MIN_VERSION})
|
||||
pkg_check_modules (GIO REQUIRED gio-2.0)
|
||||
pkg_check_modules (GOBJECT REQUIRED gobject-2.0)
|
||||
pkg_check_modules (GMODULE REQUIRED gmodule-2.0)
|
||||
@@ -216,7 +219,7 @@ if (WITH_GNUCASH)
|
||||
set(WEBKIT2 1 CACHE INTERNAL "WebKit2Gtk4")
|
||||
endif()
|
||||
|
||||
pkg_check_modules (GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0>=3.22.30)
|
||||
pkg_check_modules (GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0>=${GTK_MIN_VERSION})
|
||||
endif()
|
||||
|
||||
pkg_check_modules (ZLIB REQUIRED zlib)
|
||||
@@ -772,15 +775,28 @@ set(PLATFORM_OSX 1)
|
||||
set(HAVE_OSX_KEYCHAIN 1)
|
||||
endif()
|
||||
|
||||
if(WARN_DEPRECATED_GLIB)
|
||||
string(REGEX MATCH "^([0-9]+)\.([0-9]+)" GLIB_MIN_MATCH ${GLIB_MIN_VERSION})
|
||||
set(GLIB_API ${CMAKE_MATCH_1}_${CMAKE_MATCH_2})
|
||||
|
||||
if(DISABLE_DEPRECATED_GTK)
|
||||
set(GTK_DISABLE_DEPRECATED 1)
|
||||
set(GDK_DISABLE_DEPRECATED 1)
|
||||
set(GDK_PIXMAP_DISABLE_DEPRECATED 1)
|
||||
target_compile_definitions(PkgConfig::GLIB2 INTERFACE
|
||||
GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_${GLIB_API}
|
||||
GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_${GLIB_API})
|
||||
else()
|
||||
target_compile_definitions(PkgConfig::GLIB2 INTERFACE
|
||||
GLIB_DISABLE_DEPRECATION_WARNINGS)
|
||||
endif()
|
||||
|
||||
if(DISABLE_DEPRECATED_GLIB)
|
||||
set(G_DISABLE_DEPRECATED 1)
|
||||
if (WARN_DEPRECATED_GTK)
|
||||
string(REGEX MATCH "^([0-9]+)\.([0-9]+)" GTK_MIN_MATCH ${GTK_MIN_VERSION})
|
||||
set(GTK_API ${CMAKE_MATCH_1}_${CMAKE_MATCH_2})
|
||||
|
||||
target_compile_definitions(PkgConfig::GTK3 INTERFACE
|
||||
GDK_VERSION_MIN_REQUIRED=GDK_VERSION_${GTK_API}
|
||||
GDK_VERSION_MAX_ALLOWED=GDK_VERSION_${GTK_API})
|
||||
else()
|
||||
target_compile_definitions(PkgConfig::GTK3 INTERFACE
|
||||
GDK_DISABLE_DEPRECATION_WARNINGS)
|
||||
endif()
|
||||
|
||||
add_definitions (-DHAVE_CONFIG_H)
|
||||
|
||||
Reference in New Issue
Block a user