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.6KB

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