diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..0a06383 --- /dev/null +++ b/meson.build @@ -0,0 +1,70 @@ +project('imgui', 'cpp', + version: '1.78', + license: 'MIT', +) + +# Folder `examples` is needed, as it includes +# the implementations for different rendering backends and +# context creation APIs +include_dirs = include_directories('.', 'examples') + +sources = ['imgui_demo.cpp', 'imgui_draw.cpp', 'imgui_widgets.cpp', 'imgui.cpp'] +if get_option('opengl3').enabled() + sources += 'examples/imgui_impl_opengl3.cpp' +endif +if get_option('dx12').enabled() + sources += 'examples/imgui_impl_dx12.cpp' +endif +if get_option('dx9').enabled() + sources += 'examples/imgui_impl_dx9.cpp' +endif +if get_option('opengl2').enabled() + sources += 'examples/imgui_impl_opengl2.cpp' +endif +if get_option('glut').enabled() + sources += 'examples/imgui_impl_glut.cpp' +endif +if get_option('dx11').enabled() + sources += 'examples/imgui_impl_dx11.cpp' +endif +if get_option('win32').enabled() + sources += 'examples/imgui_impl_win32.cpp' +endif +if get_option('sdl2').enabled() + sources += 'examples/imgui_impl_sdl.cpp' +endif +if get_option('glfw').enabled() + sources += 'examples/imgui_impl_glfw.cpp' +endif +if get_option('dx10').enabled() + sources += 'examples/imgui_impl_dx10.cpp' +endif +if get_option('allegro5').enabled() + sources += 'examples/imgui_impl_allegro5.cpp' +endif +if get_option('vulkan').enabled() + sources += 'examples/imgui_impl_vulkan.cpp' +endif +if get_option('marmalade').enabled() + sources += 'examples/imgui_impl_marmalade.cpp' +endif +if get_option('osx').enabled() + sources += 'examples/imgui_impl_osx.mm' +endif +if get_option('metal').enabled() + sources += 'examples/imgui_impl_metal.mm' +endif + +imgui = library('imgui', + sources, + dependencies: [ + # TODO: add other dependencies + dependency('vulkan', required: get_option('vulkan')), + dependency('glfw3', required: get_option('glfw')), + dependency('sdl2', required: get_option('sdl2')), + dependency('glut', required: get_option('glut')), + ], + include_directories: include_dirs, +) + +imgui_dep = declare_dependency(include_directories: include_dirs, link_with: imgui) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..04bba26 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,20 @@ +# renderer +option('dx9', type: 'feature', value: 'auto') +option('dx10', type: 'feature', value: 'auto') +option('dx11', type: 'feature', value: 'auto') +option('dx12', type: 'feature', value: 'auto') +option('metal', type: 'feature', value: 'auto') +option('opengl2', type: 'feature', value: 'auto') +option('opengl3', type: 'feature', value: 'auto') +option('vulkan', type: 'feature', value: 'auto') + +#platform +option('glfw', type: 'feature', value: 'auto') +option('osx', type: 'feature', value: 'auto') +option('sdl2', type: 'feature', value: 'auto') +option('win32', type: 'feature', value: 'auto') +option('glut', type: 'feature', value: 'auto') + +#frameworks +option('marmalade', type: 'feature', value: 'auto') +option('allegro5', type: 'feature', value: 'auto') diff --git a/upstream.wrap b/upstream.wrap new file mode 100644 index 0000000..9d1da0b --- /dev/null +++ b/upstream.wrap @@ -0,0 +1,7 @@ +[wrap-file] +directory = imgui-1.78 + +source_url = https://github.com/ocornut/imgui/archive/v1.78.tar.gz +source_filename = v1.78.tar.gz +source_hash = f70bbb17581ee2bd42fda526d9c3dc1a5165f3847ff047483d4d7980e166f9a3 +