Skip to content

Commit

Permalink
Fix build with glib < 2.62
Browse files Browse the repository at this point in the history
Former-commit-id: a87323c
  • Loading branch information
tkashkin committed Apr 15, 2020
1 parent fab1bef commit 283e330
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/data/providers/images/Steam.vala
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ namespace GameHub.Data.Providers.Images
try
{
// Get modification time so we refresh only once a day
modification_date = cache_file.query_info("*", NONE).get_modification_date_time();
#if GLIB_2_62
modification_date = cache_file.query_info("*", FileQueryInfoFlags.NONE).get_modification_date_time();
#else
modification_date = new DateTime.from_timeval_utc(cache_file.query_info("*", FileQueryInfoFlags.NONE).get_modification_time());
#endif
}
catch(Error e)
{
Expand Down
16 changes: 11 additions & 5 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,18 @@ elif get_option('os') == 'macos'
add_global_arguments('-D', 'OS_MACOS', language: 'vala')
endif

glib256 = dependency('glib-2.0', version: '>=2.56', required: false)
if glib256.found()
add_global_arguments('-D', 'GLIB_2_56', language: 'vala')
deps += glib256
glib262 = dependency('glib-2.0', version: '>=2.62', required: false)
if glib262.found()
add_global_arguments('-D', 'GLIB_2_62', '-D', 'GLIB_2_56', language: 'vala')
deps += glib262
else
deps += dependency('glib-2.0')
glib256 = dependency('glib-2.0', version: '>=2.56', required: false)
if glib256.found()
add_global_arguments('-D', 'GLIB_2_56', language: 'vala')
deps += glib256
else
deps += dependency('glib-2.0')
endif
endif

gtk322 = dependency('gtk+-3.0', version: '>=3.22', required: false)
Expand Down

0 comments on commit 283e330

Please sign in to comment.