Boksi is a C89 cross platform library for putting a message box on the screen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

meson.build 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. project('boksi', 'c', default_options : ['default_library=static', 'c_std=gnu89'])
  2. incdir = include_directories(['include', 'src', 'src/methods', 'src/dynload'])
  3. boksisrc = ['src/boksi.c', 'src/methods/boksi_gtk3.c', 'src/methods/boksi_gtk2.c', 'src/methods/boksi_xaw.c', 'src/methods/boksi_xcb.c', 'src/methods/boksi_std.c', 'src/methods/boksi_win.c', 'src/methods/boksi_osx.c', 'src/methods/boksi_ncurses.c', 'src/methods/boksi_libui.c']
  4. if get_option('buildtype').startswith('debug')
  5. add_project_arguments('-DBOKSI_DEBUG_SELF', language : 'c')
  6. endif
  7. #sometimes 'dependency' doesn't work. For that, we need this
  8. cc = meson.get_compiler('c')
  9. depgtk = dependency('gtk+-3.0', required:false)
  10. if depgtk.found()
  11. add_project_arguments('-DBOKSI_BUILD_GTK3', language : 'c')
  12. endif
  13. deplibui = cc.find_library('libui', required:false)
  14. if not depgtk.found()
  15. depgtk = dependency('gtk+-2.0', required:false)
  16. if depgtk.found()
  17. add_project_arguments('-DBOKSI_BUILD_GTK2', language : 'c')
  18. endif
  19. else
  20. #This thing depends on 3.x too
  21. if deplibui.found()
  22. add_project_arguments('-DBOKSI_BUILD_LIBUI', language : 'c')
  23. endif
  24. endif
  25. depxt = dependency('xt', required:false)
  26. if depxt.found()
  27. depxaw = cc.find_library('Xaw', required:false)
  28. if depxaw.found()
  29. add_project_arguments('-DBOKSI_BUILD_XAW', language : 'c')
  30. endif
  31. else
  32. depxaw = cc.find_library('fake_library_boksi', required:false)
  33. endif
  34. depxcb = dependency('xcb', required:false)
  35. #depxlib = cc.find_library('Xlib', required:false)
  36. if depxcb.found()
  37. add_project_arguments('-DBOKSI_BUILD_XCB', language : 'c')
  38. endif
  39. depncurses = cc.find_library('ncurses', required:false)
  40. if depncurses.found()
  41. #Currently it won't build on windows. Disabling ncurses for cross builds for now.
  42. if not meson.is_cross_build()
  43. add_project_arguments('-DBOKSI_BUILD_NCURSES', language : 'c')
  44. endif
  45. endif
  46. subproject('dynload', default_options : ['default_library=static', 'c_std=gnu89'])
  47. depdynload = dependency('dynload', fallback : ['dynload', 'dynload_dep'])
  48. #library
  49. libboksi = library('boksi', boksisrc, include_directories : incdir, dependencies: [depdynload, depgtk, depxt, depxaw, depncurses, deplibui, depxcb] )
  50. boksi_dep = declare_dependency(link_with : libboksi, include_directories : incdir)
  51. if not meson.is_subproject()
  52. executable('boksibasic', 'src/example/basic.c', include_directories : incdir, dependencies: boksi_dep)
  53. executable('boksicomplex', 'src/example/complex.c', include_directories : incdir, dependencies: boksi_dep)
  54. endif