Support compiling demos in wasm build
This commit is contained in:
parent
d1c48e4c5f
commit
3eb4a40c39
11 changed files with 139 additions and 43 deletions
|
|
@ -1,24 +1,33 @@
|
|||
project('cimgui', 'cpp', version : '1.73.0', default_options: ['default_library=shared', 'warning_level=1'])
|
||||
project('cimgui', 'cpp', version : '1.73.0', default_options: ['default_library=static', 'warning_level=1'])
|
||||
|
||||
# Files
|
||||
src = [
|
||||
src = files(
|
||||
'cimgui.cpp',
|
||||
'imgui/imgui.cpp',
|
||||
'imgui/imgui_draw.cpp',
|
||||
'imgui/imgui_demo.cpp',
|
||||
'imgui/imgui_widgets.cpp',
|
||||
]
|
||||
)
|
||||
|
||||
inc = [ '.' ]
|
||||
inc +='imgui/examples/'
|
||||
pub_inc = [ 'imgui' ]
|
||||
|
||||
# Dependencies
|
||||
# bindbc_loader_dep = dependency('bindbc-loader')
|
||||
if host_machine.cpu_family() == 'wasm32'
|
||||
# For wasm we use C++ events/image handling implementation
|
||||
src += files(
|
||||
'imgui/examples/imgui_impl_opengl3.cpp',
|
||||
'imgui/examples/imgui_impl_sdl.cpp',
|
||||
)
|
||||
endif
|
||||
|
||||
lib = shared_library('cimgui', src,
|
||||
# dependencies : bindbc_loader_dep,
|
||||
|
||||
add_project_arguments('-DIMGUI_IMPL_API=extern "C" ', language : 'cpp')
|
||||
|
||||
# Dependencies
|
||||
lib = library('cimgui', src,
|
||||
include_directories : [inc, pub_inc],
|
||||
# pic : true,
|
||||
pic : true,
|
||||
)
|
||||
|
||||
cimgui_dep = declare_dependency(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue