Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/system-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,39 @@ jobs:
- name: Build
run: meson compile -C build/

- name: Verify Qt-only frontend
if: matrix.build_type == 'debug'
env:
CC: ccache ${{ matrix.platform.cc }}
CXX: ccache ${{ matrix.platform.cxx }}
run: |
meson setup build-qt-only/ \
--buildtype=debug \
--wrap-mode=forcefallback \
-Dtesting=false -Dexamples=false \
-Dqt=true -Dglfw=false -Dimgui=false
ninja -C build-qt-only/ \
visualization/libbalsaVisualization.so.p/src_qt_vulkan_film.cpp.o \
visualization/libbalsaVisualization.so.p/src_qt_vulkan_window.cpp.o \
visualization/tools/mesh_viewer_qt.p/mesh_viewer_qt.cpp.o

- name: Verify GLFW ImGui frontend
if: matrix.build_type == 'debug'
env:
CC: ccache ${{ matrix.platform.cc }}
CXX: ccache ${{ matrix.platform.cxx }}
run: |
meson setup build-glfw-imgui/ \
--buildtype=debug \
--wrap-mode=forcefallback \
-Dtesting=false -Dexamples=false \
-Dqt=false -Dglfw=true -Dimgui=true
ninja -C build-glfw-imgui/ \
visualization/libbalsaVisualization.so.p/src_glfw_vulkan_film.cpp.o \
visualization/libbalsaVisualization.so.p/src_glfw_vulkan_window.cpp.o \
visualization/libbalsaVisualization.so.p/src_vulkan_imgui_integration.cpp.o \
visualization/tools/mesh_viewer_glfw.p/mesh_viewer_glfw.cpp.o

- name: ccache stats
run: ccache -s

Expand Down
6 changes: 3 additions & 3 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ option('openvdb', type : 'boolean', value : false, description : 'Build openvdb
option('json', type : 'boolean', value : true, description : 'Use json')
option('protobuf', type : 'boolean', value : false, description : 'Use protobuf')
option('partio', type : 'boolean', value : false, description : 'Use partio')
option('imgui', type : 'boolean', value : true, description : 'Use imgui')
option('imgui', type : 'boolean', value : true, description : 'Build the ImGui UI frontend (currently requires GLFW)')
option('alembic', type : 'boolean', value : false, description : 'Use alembic')
option('perfetto', type : 'boolean', value : false, description : 'Use perfetto')

option('visualization', type : 'boolean', value : true, description : 'Build visualization library')
option('glfw', type : 'boolean', value : true, description : 'Use glfw')
option('qt', type : 'boolean', value : true, description : 'Use qt')
option('glfw', type : 'boolean', value : true, description : 'Build the GLFW window backend')
option('qt', type : 'boolean', value : true, description : 'Build the Qt window and widget frontend')
19 changes: 15 additions & 4 deletions visualization/examples/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@

test_example_scene_dep = static_library('vulkan_scene', 'vulkan_scene.cpp', dependencies: [visualization_dep])
executable('vulkan_window', 'vulkan_window.cpp', 'vulkan_scene.cpp', dependencies: [visualization_dep])
#executable('test_vulkan_window', 'test_vulkan_window.cpp', 'example_vulkan_scene.cpp', dependencies: [visualization_dep])
executable('vulkan_window_glfw', 'vulkan_window_glfw.cpp', dependencies: [visualization_dep], link_with: [test_example_scene_dep])
# The existing example scene includes an ImGui overlay, so only build it for
# the GLFW + ImGui frontend. Qt-only examples should not acquire ImGui.
if get_option('glfw') and get_option('imgui')
test_example_scene_dep = static_library(
'vulkan_scene',
'vulkan_scene.cpp',
dependencies: [visualization_dep],
)
executable(
'vulkan_window_glfw',
'vulkan_window_glfw.cpp',
dependencies: [visualization_dep],
link_with: [test_example_scene_dep],
)
endif
29 changes: 27 additions & 2 deletions visualization/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ vulkan_dep = dependency('vulkan', required: false)

shaderc_dep = dependency('shaderc')

if get_option('imgui') and not get_option('glfw')
error('The ImGui frontend currently requires GLFW; enable -Dglfw=true or disable -Dimgui')
endif

# Shader source files are part of the dependency contract, so a binary system
# package cannot satisfy it. Always use the pinned source subproject.
colormap_proj = subproject('colormap_shaders')
Expand Down Expand Up @@ -42,7 +46,28 @@ endif
imgui_backend_sources = []
imgui_backend_inc = []
if get_option('imgui')
imgui_dep = dependency('imgui')
imgui_dep = dependency(
'imgui',
default_options: [
'dx9=disabled',
'dx10=disabled',
'dx11=disabled',
'dx12=disabled',
'metal=disabled',
'opengl=disabled',
'sdl2_renderer=disabled',
'sdl3_renderer=disabled',
'sdl3_gpu=disabled',
'vulkan=enabled',
'webgpu=disabled',
'glfw=enabled',
'sdl2=disabled',
'sdl3=disabled',
'osx=disabled',
'win=disabled',
'allegro5=disabled',
],
)
if imgui_dep.type_name() != 'internal'
imgui_prefix = imgui_dep.get_variable(pkgconfig: 'prefix')
imgui_bd = imgui_prefix / 'res' / 'bindings'
Expand Down Expand Up @@ -148,7 +173,7 @@ meson.override_dependency('balsaVisualization', visualization_dep)
if get_option('testing')
subdir('tests')
endif
if get_option('examples')
if get_option('examples') and get_option('glfw') and get_option('imgui')
subdir('examples')
endif
subdir('tools')
64 changes: 35 additions & 29 deletions visualization/tools/meson.build
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@

cli11_dep = dependency('CLI11', required: false, allow_fallback: true)

# ── mesh_viewer_glfw ─────────────────────────────────────────────────
mesh_viewer_glfw_deps = [visualization_dep]
mesh_viewer_glfw_args = []
if cli11_dep.found()
mesh_viewer_glfw_deps += cli11_dep
mesh_viewer_glfw_args += '-DBALSA_HAS_CLI11=1'
if get_option('qt') or (get_option('glfw') and get_option('imgui'))
cli11_dep = dependency('CLI11', required: false, allow_fallback: true)
endif
executable('mesh_viewer_glfw', 'mesh_viewer_glfw.cpp',
dependencies: mesh_viewer_glfw_deps,
cpp_args: mesh_viewer_glfw_args)

# ── mesh_viewer_qt ───────────────────────────────────────────────────
mesh_viewer_qt_deps = [visualization_dep]
mesh_viewer_qt_args = []
if cli11_dep.found()
mesh_viewer_qt_deps += cli11_dep
mesh_viewer_qt_args += '-DBALSA_HAS_CLI11=1'
if get_option('glfw') and get_option('imgui')
# ── mesh_viewer_glfw ───────────────────────────────────────────────
mesh_viewer_glfw_deps = [visualization_dep]
mesh_viewer_glfw_args = []
if cli11_dep.found()
mesh_viewer_glfw_deps += cli11_dep
mesh_viewer_glfw_args += '-DBALSA_HAS_CLI11=1'
endif
executable('mesh_viewer_glfw', 'mesh_viewer_glfw.cpp',
dependencies: mesh_viewer_glfw_deps,
cpp_args: mesh_viewer_glfw_args)

# ── image_viewer_glfw ──────────────────────────────────────────────
image_viewer_glfw_deps = [visualization_dep]
image_viewer_glfw_args = []
if cli11_dep.found()
image_viewer_glfw_deps += cli11_dep
image_viewer_glfw_args += '-DBALSA_HAS_CLI11=1'
endif
executable('image_viewer_glfw', 'image_viewer_glfw.cpp',
dependencies: image_viewer_glfw_deps,
cpp_args: image_viewer_glfw_args)
endif
executable('mesh_viewer_qt', 'mesh_viewer_qt.cpp',
dependencies: mesh_viewer_qt_deps,
cpp_args: mesh_viewer_qt_args)

# ── image_viewer_glfw ────────────────────────────────────────────────
image_viewer_glfw_deps = [visualization_dep]
image_viewer_glfw_args = []
if cli11_dep.found()
image_viewer_glfw_deps += cli11_dep
image_viewer_glfw_args += '-DBALSA_HAS_CLI11=1'
if get_option('qt')
# ── mesh_viewer_qt ─────────────────────────────────────────────────
mesh_viewer_qt_deps = [visualization_dep]
mesh_viewer_qt_args = []
if cli11_dep.found()
mesh_viewer_qt_deps += cli11_dep
mesh_viewer_qt_args += '-DBALSA_HAS_CLI11=1'
endif
executable('mesh_viewer_qt', 'mesh_viewer_qt.cpp',
dependencies: mesh_viewer_qt_deps,
cpp_args: mesh_viewer_qt_args)
endif
executable('image_viewer_glfw', 'image_viewer_glfw.cpp',
dependencies: image_viewer_glfw_deps,
cpp_args: image_viewer_glfw_args)