tests: pass WITH_MESH_OPTIMIZER into test_lod_builder

LodBuilder.cpp guards its real body behind #ifdef WITH_MESH_OPTIMIZER
(the stub is `return;`). The IfcViewer static lib propagates the
define via target_compile_definitions, but test_lod_builder compiles
LodBuilder.cpp standalone (it doesn't link IfcViewer), so the test
silently exercised the no-op path. summariseLods and buildLods cases
asserted on the post-build state and saw zero LOD1 output.

Pre-existing regression since 884e7ba32 ("Make meshoptim optional");
adds the define to the test target directly so the real build path
runs. 5/5 LOD cases pass after.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-06-01 17:40:55 +10:00
parent 379f913f65
commit 42ab97b134
+6
View File
@@ -38,6 +38,12 @@ if(WITH_MESH_OPTIMIZER)
${IFCVIEWER_SRC}/LodBuilder.cpp
LIBS meshoptimizer::meshoptimizer
)
# LodBuilder.cpp's body is guarded behind WITH_MESH_OPTIMIZER; without
# the define the test compiles the no-op stub and the buildLods
# assertions fail. The IfcViewer library propagates this define via
# target_compile_definitions but the test compiles LodBuilder.cpp
# standalone, so the test target has to set it explicitly.
target_compile_definitions(test_lod_builder PRIVATE -DWITH_MESH_OPTIMIZER)
endif()
add_ifcviewer_unit_test(test_sidecar_cache