From 938dda80d0085c9da0c2a0da62db575bca78be4e Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Tue, 2 Jun 2026 07:53:57 +1000 Subject: [PATCH] ci: GCC 11 portability + BUNDLE DESTINATION "." on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Linux (Rocky manylinux, GCC 11): - WgpuAreaMeasurement.h: include directly. GCC 11 does not transitively pull `size_t` through , so triangleCount()'s return type fails to parse. - WgpuViewportWindow.cpp:meshLocalToGlobal: use static_cast(...) instead of double(mesh_local[N]) when constructing the Eigen::Vector4d. The latter triggers GCC 11's most-vexing-parse: it reads `Vector4d local(double(mesh_local[0]), double(mesh_local[1]), ...)` as a function declaration of `local` taking parameters `double mesh_local[0]` etc., colliding with the outer `mesh_local` parameter and failing with "redefinition of double* mesh_local". macOS arm64: - IfcViewerWgpuMinimal + BonsaiViewer install rules: change `BUNDLE DESTINATION bin` → `BUNDLE DESTINATION .`. Qt's deploy generator emits `macdeployqt .app` with no path prefix, which only resolves when the bundle sits at the install-prefix root. `BUNDLE DESTINATION bin` put it at `/bin/Target.app` and the install/strip step failed with "Could not find app bundle". Co-Authored-By: Claude Opus 4.7 --- src/bonsaiviewer/CMakeLists.txt | 7 ++++--- src/ifcviewer-wgpu-minimal/CMakeLists.txt | 10 ++++++---- src/ifcviewer-wgpu/WgpuAreaMeasurement.h | 1 + src/ifcviewer-wgpu/WgpuViewportWindow.cpp | 10 +++++++--- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/bonsaiviewer/CMakeLists.txt b/src/bonsaiviewer/CMakeLists.txt index e933a1a65c..69f07fd804 100644 --- a/src/bonsaiviewer/CMakeLists.txt +++ b/src/bonsaiviewer/CMakeLists.txt @@ -133,11 +133,12 @@ target_link_libraries(BonsaiViewer PRIVATE Qt${QT_VERSION}::Widgets ) -# MACOSX_BUNDLE targets require BUNDLE DESTINATION at install time even when -# nobody runs `make install` (CMake validates the rule at configure). +# BUNDLE DESTINATION must be "." (install-prefix root) on macOS — Qt's +# deploy generator emits `macdeployqt BonsaiViewer.app` (no path +# prefix), which resolves only when the .app sits at the install root. install(TARGETS BonsaiViewer EXPORT ${IFCOPENSHELL_EXPORT_TARGETS} RUNTIME DESTINATION bin - BUNDLE DESTINATION bin + BUNDLE DESTINATION . ) ifcopenshell_deploy_qt_runtime(BonsaiViewer) diff --git a/src/ifcviewer-wgpu-minimal/CMakeLists.txt b/src/ifcviewer-wgpu-minimal/CMakeLists.txt index 2ef2edfcca..f68a316a0c 100644 --- a/src/ifcviewer-wgpu-minimal/CMakeLists.txt +++ b/src/ifcviewer-wgpu-minimal/CMakeLists.txt @@ -45,12 +45,14 @@ if(UNIX AND NOT APPLE AND WGPU_NATIVE_LIB_DIR) ) endif() -# MACOSX_BUNDLE targets require BUNDLE DESTINATION at install time even -# when nobody is going to run `make install` (CMake validates the rule -# at configure). Provide one alongside the regular bin/ runtime path. +# BUNDLE DESTINATION must be "." (install-prefix root) on macOS — Qt's +# deploy generator emits `macdeployqt IfcViewerWgpuMinimal.app` (no +# path prefix), which resolves only when the .app sits at the install +# root. With `bin/` it can't find the bundle and the install/strip +# step fails. install(TARGETS IfcViewerWgpuMinimal EXPORT ${IFCOPENSHELL_EXPORT_TARGETS} RUNTIME DESTINATION bin - BUNDLE DESTINATION bin + BUNDLE DESTINATION . ) ifcopenshell_deploy_qt_runtime(IfcViewerWgpuMinimal) diff --git a/src/ifcviewer-wgpu/WgpuAreaMeasurement.h b/src/ifcviewer-wgpu/WgpuAreaMeasurement.h index fd2e51d221..13dd608875 100644 --- a/src/ifcviewer-wgpu/WgpuAreaMeasurement.h +++ b/src/ifcviewer-wgpu/WgpuAreaMeasurement.h @@ -20,6 +20,7 @@ #ifndef WGPUAREAMEASUREMENT_H #define WGPUAREAMEASUREMENT_H +#include #include #include #include diff --git a/src/ifcviewer-wgpu/WgpuViewportWindow.cpp b/src/ifcviewer-wgpu/WgpuViewportWindow.cpp index 307fe1c05c..9ffe0689e4 100644 --- a/src/ifcviewer-wgpu/WgpuViewportWindow.cpp +++ b/src/ifcviewer-wgpu/WgpuViewportWindow.cpp @@ -3136,9 +3136,13 @@ bool WgpuViewportWindow::meshLocalToGlobal(uint32_t object_id, using Mat4dCol = Eigen::Matrix; const Eigen::Matrix4d P = Eigen::Map(inst.placement_transformation); - const Eigen::Vector4d local(double(mesh_local[0]), - double(mesh_local[1]), - double(mesh_local[2]), + // static_cast (not `double(...)`) to dodge GCC 11's most-vexing-parse: + // `Vector4d local(double(mesh_local[0]),…)` is otherwise read as a + // function declaration of `local` whose parameter is `double mesh_local[0]`, + // shadowing the outer `mesh_local` parameter. + const Eigen::Vector4d local(static_cast(mesh_local[0]), + static_cast(mesh_local[1]), + static_cast(mesh_local[2]), 1.0); const Eigen::Vector3d global = (m.coordinate_operation_meters * P * local).head<3>();