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.
 
 
 
 

74 lines
2.6 KiB

project('boksi', 'c', default_options : ['default_library=static', 'c_std=c99'], subproject_dir : 'meson')
#add_project_arguments(['-Werror', '-Wall', '-Wpedantic', '-Wextra'], language : 'c')
add_project_arguments(['-Werror', '-Wall', '-Wpedantic'], language : 'c')
incdir = include_directories(['include', 'src', 'src/methods', 'src/dynload'])
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']
if get_option('buildtype').startswith('debug')
add_project_arguments('-DBOKSI_DEBUG_SELF', language : 'c')
endif
#sometimes 'dependency' doesn't work. For that, we need this
cc = meson.get_compiler('c')
depgtk = dependency('gtk+-3.0', required:false)
if depgtk.found()
add_project_arguments('-DBOKSI_BUILD_GTK3', language : 'c')
endif
deplibui = cc.find_library('libui', required:false)
if not depgtk.found()
depgtk = dependency('gtk+-2.0', required:false)
if depgtk.found()
add_project_arguments('-DBOKSI_BUILD_GTK2', language : 'c')
endif
else
#This thing depends on 3.x too
if deplibui.found()
add_project_arguments('-DBOKSI_BUILD_LIBUI', language : 'c')
endif
endif
depxt = dependency('xt', required:false)
if depxt.found()
depxaw = cc.find_library('Xaw', required:false)
if depxaw.found()
add_project_arguments('-DBOKSI_BUILD_XAW', language : 'c')
endif
else
depxaw = cc.find_library('fake_library_boksi', required:false)
endif
depxcb = dependency('xcb', required:false)
#depxlib = cc.find_library('Xlib', required:false)
if depxcb.found()
add_project_arguments('-DBOKSI_BUILD_XCB', language : 'c')
endif
depncurses = cc.find_library('ncurses', required:false)
if depncurses.found()
#Currently it won't build on windows. Disabling ncurses for cross builds for now.
if not meson.is_cross_build()
add_project_arguments('-DBOKSI_BUILD_NCURSES', language : 'c')
endif
endif
subproject('dynload', default_options : ['default_library=static', 'c_std=gnu89'])
depdynload = dependency('dynload', fallback : ['dynload', 'dynload_dep'])
#library
libboksi = library('boksi', boksisrc, include_directories : incdir, dependencies: [depdynload, depgtk, depxt, depxaw, depncurses, deplibui, depxcb] )
boksi_dep = declare_dependency(link_with : libboksi, include_directories : incdir)
if not meson.is_subproject()
executable('boksibasic', 'src/example/basic.c', include_directories : incdir, dependencies: boksi_dep)
executable('boksicomplex', 'src/example/complex.c', include_directories : incdir, dependencies: boksi_dep)
endif