wscript 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #! /usr/bin/env python
  2. # encoding: utf-8
  3. # Thomas Nagy, 2005, 2010 (ita)
  4. VERSION='0.0.1'
  5. APPNAME='glib2_test'
  6. top = '.'
  7. out = 'build'
  8. import os
  9. def options(opt):
  10. opt.load ('compiler_c glib2')
  11. def configure(conf):
  12. conf.load ('compiler_c glib2')
  13. conf.check_cfg (package='glib-2.0', uselib_store='GLIB', atleast_version='2.25.0',
  14. args='--cflags --libs')
  15. conf.check_cfg (package='gio-2.0', uselib_store='GIO', atleast_version='2.25.0',
  16. args='--cflags --libs')
  17. conf.check_cfg (package='gobject-2.0', uselib_store='GOBJECT', atleast_version='2.25.0',
  18. args='--cflags --libs')
  19. def build(bld):
  20. app = bld (
  21. features = 'c cprogram glib2',
  22. use = 'GLIB GIO GOBJECT',
  23. source = 'main.c org.glib2.test.gresource.xml',
  24. target = 'gsettings-test'
  25. ## An alternate way of doing this (no need to call add_ functions):
  26. # settings_enum_namespace = 'org.gsettings.test'
  27. # settings_enum_files = ['enums.h']
  28. # settings_schema_files = ['org.gsettings.test.gschema.xml']
  29. )
  30. app.add_settings_enums ('org.gsettings.test', 'enums.h')
  31. app.add_settings_schemas (['org.gsettings.test.gschema.xml',
  32. 'org.gsettings.test-2.gschema.xml'])
  33. app.add_marshal_file('marshal.list', 'test_marshal')
  34. bld(
  35. features = 'gresource',
  36. source = 'org.glib2.test.gresource.xml',
  37. install_path = 'lib/glib2_test'
  38. )
  39. # Install a schema to a different location.
  40. # It will be compiled to a cache file besides it.
  41. bld(
  42. features = 'glib2',
  43. settings_schema_files = ['org.gsettings.simple.gschema.xml']
  44. ).env.GSETTINGSSCHEMADIR = os.path.join('etc', 'glib-2.0', 'schemas')