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
2 changes: 1 addition & 1 deletion .github/actions/f3d-superbuild/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ runs:
-Dvtk_SOURCE_SELECTION=git
${{ runner.os == 'Linux' && '-DENABLE_egl=ON -DENABLE_osmesa=ON' || null }}
${{ runner.os == 'Windows' && '-G Ninja' || null }}
${{ runner.os == 'macOS' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0' || null }}
${{ runner.os == 'macOS' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0' || null }}

- name: Disable LFS during the build
working-directory: ${{github.workspace}}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/wheels/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ runs:
uses: actions/cache@v4
with:
path: fsbb/install
key: fsbb-${{runner.os}}-${{env.VTK_COMMIT_SHA}}-2
key: fsbb-${{runner.os}}-${{env.VTK_COMMIT_SHA}}-3

- name: Setup Ninja Windows
if: runner.os == 'Windows'
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/wheels/build_f3d_superbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cmake -S ./source -B ./fsbb \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
-DENABLE_f3d=OFF \
-DENABLE_alembic=ON \
-DENABLE_assimp=ON \
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function (superbuild_find_projects var)
tbb
vtk
webp
webifc
xz
zstd
zlib)
Expand Down Expand Up @@ -144,6 +145,7 @@ set(_superbuild_default_ospray ON)
set(_superbuild_default_pybind11 OFF)
set(_superbuild_default_tbb ON)
set(_superbuild_default_webp ON)
set(_superbuild_default_webifc ON)

if (NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/superbuild/CMakeLists.txt")
message(FATAL_ERROR "It appears as though the superbuild infrastructure "
Expand Down
3 changes: 2 additions & 1 deletion projects/f3d.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ superbuild_add_project(f3d
LICENSE.md
THIRD_PARTY_LICENSES.md
DEPENDS vtk cxx17
DEPENDS_OPTIONAL pybind11 alembic assimp draco imgui occt openexr openusd openvdb webp
DEPENDS_OPTIONAL pybind11 alembic assimp draco imgui occt openexr openusd openvdb webp webifc
CMAKE_ARGS
-DCMAKE_INSTALL_NAME_DIR:PATH=<INSTALL_DIR>/lib
-DF3D_LINUX_GENERATE_MAN:BOOL=${f3d_build_for_linux}
Expand All @@ -38,6 +38,7 @@ superbuild_add_project(f3d
-DF3D_PLUGIN_BUILD_OCCT:BOOL=${occt_enabled}
-DF3D_PLUGIN_BUILD_USD:BOOL=${openusd_enabled}
-DF3D_PLUGIN_BUILD_VDB:BOOL=${openvdb_enabled}
-DF3D_PLUGIN_BUILD_WEBIFC:BOOL=${webifc_enabled}
-DF3D_BINDINGS_C:BOOL=ON
-DF3D_BINDINGS_PYTHON:BOOL=${f3d_build_python_bindings}
-DF3D_BINDINGS_PYTHON_GENERATE_STUBS:BOOL=${f3d_build_python_bindings}
Expand Down
37 changes: 37 additions & 0 deletions projects/patches/webifc-remove-std-format.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
diff --git a/src/cpp/web-ifc/geometry/IfcGeometryLoader.cpp b/src/cpp/web-ifc/geometry/IfcGeometryLoader.cpp
index ebfaf3f2..13ef5d50 100644
--- a/src/cpp/web-ifc/geometry/IfcGeometryLoader.cpp
+++ b/src/cpp/web-ifc/geometry/IfcGeometryLoader.cpp
@@ -4,6 +4,7 @@

#include <spdlog/spdlog.h>
#include <iomanip>
+#include <sstream>
#include "IfcGeometryLoader.h"
#include "operations/curve-utils.h"
#include "operations/geometryutils.h"
diff --git a/src/cpp/web-ifc/parsing/IfcLoader.cpp b/src/cpp/web-ifc/parsing/IfcLoader.cpp
index ae592775..4cb54410 100644
--- a/src/cpp/web-ifc/parsing/IfcLoader.cpp
+++ b/src/cpp/web-ifc/parsing/IfcLoader.cpp
@@ -6,7 +6,8 @@
#include <string>
#include <cmath>
#include <algorithm>
-#include <format>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is webifc C++20 ? I dont think they advertise it, maybe we should ask if they want this patch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they have set(CMAKE_CXX_STANDARD 20) in their cmakelists so it seems they are

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

however, format is the only c++20 usage

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, ill ask them on their forum then

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no answer yet, ill let uyou know if they do.

+#include <charconv>
+#include <array>
#include <fast_float/fast_float.h>
#include <spdlog/spdlog.h>
#include "IfcLoader.h"
@@ -354,7 +355,9 @@ namespace webifc::parsing {

void IfcLoader::PushDouble(double input)
{
- std::string numberString = std::format("{}", input);
+ std::array<char, 64> buf;
+ auto [ptr, ec] = std::to_chars(buf.data(), buf.data() + buf.size(), input);
+ std::string numberString(buf.data(), ptr);
size_t eLoc = numberString.find_first_of('e');
if (eLoc != std::string::npos) numberString[eLoc]='E';
else if (std::floor(input) == input) numberString+='.';
10 changes: 10 additions & 0 deletions projects/webifc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
superbuild_add_project(webifc
BUILD_SHARED_LIBS_INDEPENDENT
LICENSE_FILES
LICENSE.md
SOURCE_SUBDIR src/cpp
CMAKE_ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON)

superbuild_apply_patch(webifc remove-std-format
"Replace std::format with std::to_chars for compiler compatibility")
5 changes: 5 additions & 0 deletions versions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ superbuild_set_revision(webp
DOWNLOAD_NAME webp-v1.6.0.tar.gz
URL_MD5 d498caf9323a24ce3ed40b84c22a32cd)

superbuild_set_revision(webifc
URL "https://github.com/ThatOpen/engine_web-ifc/archive/refs/tags/0.75.tar.gz"
DOWNLOAD_NAME webifc-0.75.tar.gz
URL_MD5 a75eb5132f58eeaa4db799cc085589c4)

superbuild_set_selectable_source(vtk
SELECT 9.5.2 DEFAULT
URL "https://www.vtk.org/files/release/9.5/VTK-9.5.2.tar.gz"
Expand Down
Loading