~vcs-imports/network-manager-applet/git-master

« back to all changes in this revision

Viewing changes to meson.build

  • Committer: Thomas Haller
  • Date: 2018-04-20 06:58:12 UTC
  • Revision ID: git-v1:c0d4880aa3f4589899adfed7c6f0fcf13cd3dd49
build: adjust handling of appindicator configure options

- always #define USE_AYATANA_INDICATORS to either 0 or 1 in case
  WITH_APPINDICATOR is defined.
- previously, with meson -Dappindicator=no was not working. Fix it.
- merge the autotools variant APPINDICATOR_VARIANT with the
  --with-appindicator option. We don't need two flags to select
  a particular appindicator variant.
- add "yes" as an alias for "auto". It mirrors "no". However, I wonder
  if such kind of autodetection is really desirable. Shouldn't the user
  be required to specify the variant to use?

Show diffs side-by-side

added added

removed removed

Lines of Context:
201
201
endif
202
202
 
203
203
enable_appindicator = get_option('appindicator')
204
 
if enable_appindicator == 'auto'
205
 
 
206
 
  # prefer building against Ayatana AppIndicator
207
 
 
 
204
if enable_appindicator == 'auto' or enable_appindicator == 'yes'
208
205
  appindicator_dep = dependency('ayatana-appindicator3-0.1', required: false)
209
206
  if appindicator_dep.found()
210
207
    enable_appindicator = 'ayatana'
211
208
  else
212
 
 
213
 
    # fall back to Ubuntu's AppIndicator if needed
214
 
 
215
 
    appindicator_dep = dependency('appindicator3-0.1',required: false)
 
209
    appindicator_dep = dependency('appindicator3-0.1', required: false)
216
210
    if appindicator_dep.found()
217
211
      enable_appindicator = 'ubuntu'
 
212
    else
 
213
      assert(appindicator_dep.found(), 'Neither Ubuntu\'s AppIndicator nor Ayatana AppIndicator found.')
218
214
    endif
219
215
  endif
220
 
 
221
 
  # bail out, if 'yes' was given, but not AppIndicator shared lib is available
222
 
  assert(appindicator_dep.found(), 'Neither Ubuntu\'s AppIndicator nor Ayatana AppIndicator found.')
223
 
 
224
 
endif
225
 
 
226
 
if enable_appindicator == 'ubuntu'
 
216
elif enable_appindicator == 'ayatana'
 
217
  appindicator_dep = dependency('ayatana-appindicator3-0.1')
 
218
elif enable_appindicator == 'ubuntu'
227
219
  appindicator_dep = dependency('appindicator3-0.1')
 
220
endif
 
221
 
 
222
if enable_appindicator == 'no'
 
223
  config_h.set('WITH_APPINDICATOR', false)
 
224
  config_h.set('USE_AYATANA_INDICATORS', false)
 
225
elif enable_appindicator == 'ubuntu'
228
226
  dbusmenu_dep = dependency('dbusmenu-gtk3-0.4', version: '>= 16.04.0')
229
 
  config_h.set('WITH_APPINDICATOR', true)
 
227
  config_h.set10('WITH_APPINDICATOR', true)
 
228
  config_h.set10('USE_AYATANA_INDICATORS', false)
230
229
elif enable_appindicator == 'ayatana'
231
 
  config_h.set('USE_AYATANA_INDICATORS', true)
232
 
  appindicator_dep = dependency('ayatana-appindicator3-0.1')
233
230
  dbusmenu_dep = dependency('dbusmenu-gtk3-0.4', version: '>= 16.04.0')
234
 
  config_h.set('WITH_APPINDICATOR', true)
 
231
  config_h.set10('WITH_APPINDICATOR', true)
 
232
  config_h.set10('USE_AYATANA_INDICATORS', true)
235
233
else
236
 
  error('Options allowed for -Dappindicator=<str> are: auto, ubuntu, ayatana.')
 
234
  error('Options allowed for -Dappindicator=<str> are: no, yes|auto, ayatana, ubuntu.')
237
235
endif
238
236
 
239
237
# ModemManager1 with libmm-glib for WWAN support
502
500
output = '\n  Build legacy library libnm-gtk: ' + enable_libnm_gtk.to_string() + '\n'
503
501
output += '  GCR: ' + enable_gcr.to_string() + '\n'
504
502
output += '  LTO: ' + get_option('b_lto').to_string() + '\n'
505
 
output += '  Linker garbage collection: ' + enable_ld_gc.to_string()
 
503
output += '  Linker garbage collection: ' + enable_ld_gc.to_string() + '\n'
 
504
output += '  libappindicator: ' + enable_appindicator
506
505
message(output)