From 42ab97b1342e705e9b9bb8f9626159eec30c7549 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Mon, 1 Jun 2026 17:40:55 +1000 Subject: [PATCH] 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 --- src/ifcviewer/tests/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ifcviewer/tests/CMakeLists.txt b/src/ifcviewer/tests/CMakeLists.txt index 15f361155e..83e6858ebe 100644 --- a/src/ifcviewer/tests/CMakeLists.txt +++ b/src/ifcviewer/tests/CMakeLists.txt @@ -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