zoitechat_theme_sources = [ 'theme/theme-access.c', 'theme/theme-application.c', 'theme/theme-css.c', 'theme/theme-gtk3.c', 'theme/theme-manager.c', 'theme/theme-palette.c', 'theme/theme-preferences.c', 'theme/theme-policy.c', 'theme/theme-runtime.c', ] zoitechat_gtk_sources = [ 'ascii.c', 'banlist.c', 'chanlist.c', 'chanview.c', 'custom-list.c', 'dccgui.c', 'editlist.c', 'emoji-picker.c', 'emoji-font.c', 'fe-gtk.c', 'fkeys.c', 'gtkutil.c', 'icon-resolver.c', 'ignoregui.c', 'inline-image.c', 'joind.c', 'menu.c', 'maingui.c', 'notifygui.c', 'pixmaps.c', 'preferences-persistence.c', 'plugin-tray.c', 'plugin-notification.c', 'rawlog.c', 'servlistgui.c', 'setup.c', 'sexy-spell-entry.c', 'textgui.c', 'urlgrab.c', 'userlistgui.c', 'xtext.c' ] zoitechat_gtk_cflags = [] zoitechat_gtk_deps = [ zoitechat_common_dep, libgmodule_dep, # used by libsexy ] gtk_dep = dependency('gtk+-3.0', version: '>= 3.22') # Standalone GTK tests also include the common application's headers. gtk_dep = declare_dependency(dependencies: [gtk_dep] + zoitechat_common_header_deps) # fe-gtk.h exposes GtkosxApplication to every GTK consumer when enabled. # Theme libraries and standalone UI tests need the same headers as the app. if host_machine.system() == 'darwin' and gtk_mac_dep.found() gtk_dep = declare_dependency(dependencies: [gtk_dep, gtk_mac_dep]) endif zoitechat_theme_deps = [gtk_dep, zoitechat_common_dep] if host_machine.system() != 'windows' appindicator_opt = get_option('appindicator') if appindicator_opt.allowed() appindicator_dep = dependency('ayatana-appindicator3-0.1', required: false) if appindicator_dep.found() zoitechat_gtk_deps += appindicator_dep zoitechat_gtk_cflags += '-DHAVE_AYATANA_APPINDICATOR' else appindicator_dep = dependency('appindicator3-0.1', required: false) if appindicator_dep.found() zoitechat_gtk_deps += appindicator_dep zoitechat_gtk_cflags += '-DHAVE_APPINDICATOR' elif appindicator_opt.enabled() or (appindicator_opt.auto() and host_machine.system() == 'linux') error('tray support requires ayatana-appindicator3-0.1 or appindicator3-0.1 on Linux (use -Dappindicator=disabled to override)') endif endif endif endif emoji_font_deps = [gtk_dep, dependency('pangoft2', version: '>= 1.44'), dependency('fontconfig', version: '>= 2.13')] zoitechat_gtk_deps += emoji_font_deps if host_machine.system() != 'windows' gdk_x11_dep = dependency('gdk-x11-3.0', required: false) if gdk_x11_dep.found() zoitechat_gtk_deps += gdk_x11_dep endif x11_dep = dependency('x11', required: false) if x11_dep.found() zoitechat_gtk_deps += x11_dep endif endif zoitechat_gtk_ldflags = [] zoitechat_gtk_objcflags = [] if host_machine.system() == 'windows' zoitechat_gtk_sources += 'notifications/notification-windows.c' zoitechat_gtk_deps += cc.find_library('dwmapi', required: true) zoitechat_theme_deps += cc.find_library('dwmapi', required: true) elif host_machine.system() == 'darwin' add_languages('objc', required: true) zoitechat_gtk_sources += 'notifications/notification-osx.m' zoitechat_gtk_deps += dependency('appleframeworks', modules: ['Cocoa', 'UserNotifications']) zoitechat_gtk_objcflags += '-fobjc-arc' else zoitechat_gtk_sources += 'notifications/notification-freedesktop.c' endif zoitechat_theme_lib = static_library('zoitechat_theme', sources: zoitechat_theme_sources, include_directories: [config_h_include], dependencies: zoitechat_theme_deps, install: false, ) iso_codes = dependency('iso-codes', required: false) if iso_codes.found() zoitechat_gtk_sources += 'sexy-iso-codes.c' iso_codes_prefix = iso_codes.get_variable(pkgconfig : 'prefix') zoitechat_gtk_cflags += '-DISO_CODES_PREFIX="@0@"'.format(iso_codes_prefix) zoitechat_gtk_cflags += '-DISO_CODES_LOCALEDIR="@0@"'.format( join_paths(iso_codes_prefix, 'share/locale')) endif if get_option('plugin') zoitechat_gtk_sources += 'plugingui.c' endif resources = gnome.compile_resources('resources', '../../data/zoitechat.gresource.xml', source_dir: '../../data', c_name: 'zoitechat', extra_args: ['--manual-register'] ) if host_machine.system() == 'windows' zoitechat_gtk_ldflags += '-Wl,-e,mainCRTStartup' endif executable('zoitechat', sources: resources + zoitechat_gtk_sources, dependencies: zoitechat_gtk_deps, link_with: zoitechat_theme_lib, c_args: zoitechat_gtk_cflags, objc_args: zoitechat_gtk_objcflags, link_args: zoitechat_gtk_ldflags, pie: true, install: true, win_subsystem: 'windows', ) emoji_ui_tests = executable('emoji_ui_tests', ['tests/test-emoji-ui.c', 'emoji-font.c', 'emoji-picker.c', '../common/emoji-data.c', emoji_data_table], include_directories: [config_h_include, include_directories('../common')], dependencies: emoji_font_deps, ) test('Emoji UI Tests', emoji_ui_tests, env: ['ZOITECHAT_EMOJI_FONT=' + join_paths(meson.source_root(), 'data/fonts/NotoColorEmoji.ttf')], protocol: 'tap', timeout: 120, ) theme_manager_policy_tests = executable('theme_manager_policy_tests', [ 'theme/tests/test-theme-manager-policy.c', 'theme/theme-manager.c', 'theme/theme-palette.c', 'theme/tests/test-theme-gtk3-stub.c', ], include_directories: [config_h_include], dependencies: [gtk_dep], ) test('Theme Manager/Policy Tests', theme_manager_policy_tests, protocol: 'tap', timeout: 120, ) theme_manager_dispatch_tests = executable('theme_manager_dispatch_routing_tests', [ 'theme/tests/test-theme-manager-dispatch-routing.c', 'theme/theme-manager.c', 'theme/theme-palette.c', 'theme/tests/test-theme-gtk3-stub.c', ], include_directories: [config_h_include], dependencies: [gtk_dep], ) test('Theme Manager Dispatch Routing Tests', theme_manager_dispatch_tests, protocol: 'tap', timeout: 120, ) theme_manager_auto_refresh_tests = executable('theme_manager_auto_refresh_tests', [ 'theme/tests/test-theme-manager-auto-refresh.c', 'theme/theme-manager.c', 'theme/theme-palette.c', 'theme/tests/test-theme-gtk3-stub.c', ], include_directories: [config_h_include], dependencies: [gtk_dep], ) test('Theme Manager Auto Refresh Tests', theme_manager_auto_refresh_tests, protocol: 'tap', timeout: 120, ) theme_application_input_style_tests = executable('theme_application_input_style_tests', [ 'theme/tests/test-theme-application-input-style.c', 'theme/theme-application.c', 'theme/tests/test-theme-gtk3-stub.c', ], include_directories: [config_h_include], dependencies: [gtk_dep], ) test('Theme Application Input Style Tests', theme_application_input_style_tests, protocol: 'tap', timeout: 120, ) theme_runtime_tests = executable('theme_runtime_persistence_tests', 'theme/tests/test-theme-runtime-persistence.c', include_directories: [config_h_include], dependencies: [gtk_dep], link_with: zoitechat_theme_lib, ) test('Theme Runtime Persistence Tests', theme_runtime_tests, protocol: 'tap', timeout: 120, ) theme_access_tests = executable('theme_access_routing_tests', 'theme/tests/test-theme-access-routing.c', include_directories: [config_h_include], dependencies: [gtk_dep], link_with: zoitechat_theme_lib, ) test('Theme Access Routing Tests', theme_access_tests, protocol: 'tap', timeout: 120, ) theme_gtk3_settings_tests = executable('theme_gtk3_settings_tests', [ 'theme/tests/test-theme-gtk3-settings.c', 'theme/theme-gtk3.c', ], include_directories: [config_h_include], dependencies: [gtk_dep], ) test('Theme GTK3 Settings Tests', theme_gtk3_settings_tests, protocol: 'tap', timeout: 120, ) theme_preferences_gtk3_populate_tests = executable('theme_preferences_gtk3_populate_tests', 'theme/tests/test-theme-preferences-gtk3-populate.c', include_directories: [config_h_include], dependencies: [gtk_dep], ) test('Theme Preferences GTK3 Populate Tests', theme_preferences_gtk3_populate_tests, protocol: 'tap', timeout: 120, ) emoji_font_tests = executable('emoji_font_tests', ['tests/test-emoji-font.c', 'emoji-font.c', '../common/emoji-data.c', emoji_data_table], include_directories: [config_h_include, include_directories('../common')], dependencies: emoji_font_deps, ) test('Emoji Font Tests', emoji_font_tests, env: ['ZOITECHAT_EMOJI_FONT=' + join_paths(meson.source_root(), 'data/fonts/NotoColorEmoji.ttf')], protocol: 'tap', timeout: 120, ) xtext_tests = executable('xtext_tests', ['tests/test-xtext.c', '../common/hexcolor.c'], include_directories: [config_h_include], dependencies: [gtk_dep], ) test('XText Tests', xtext_tests, protocol: 'tap', timeout: 120)