From 5ca2436298366ff43311f1f17a69abe05251c437 Mon Sep 17 00:00:00 2001 From: Qingnan Zhou Date: Sat, 27 Dec 2025 23:39:45 +0800 Subject: [PATCH] Compilation fix. --- CMakeLists.txt | 3 ++- cmake/conformal_ideal_delaunay.cmake | 2 ++ cmake/directional.cmake | 1 + cmake/libigl.cmake | 2 +- src/CMakeLists.txt | 2 +- src/holonomy/field/facet_field.cpp | 2 +- src/holonomy/field/intrinsic_field.cpp | 2 +- src/optimization/parameterization/layout.cpp | 6 +++--- src/util/CMakeLists.txt | 1 + 9 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ebc2eb..b0e8298 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 3.25) project(PennerOptimization) -set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) add_compile_options(-fPIC) @@ -106,6 +105,8 @@ add_library(DirectionalLib INTERFACE) target_include_directories(DirectionalLib SYSTEM INTERFACE ${directional_SOURCE_DIR}/include ) +target_compile_features(DirectionalLib INTERFACE cxx_std_20) + # Optionally create rendering library if(RENDER_TEXTURE) diff --git a/cmake/conformal_ideal_delaunay.cmake b/cmake/conformal_ideal_delaunay.cmake index 276533f..461c7ad 100644 --- a/cmake/conformal_ideal_delaunay.cmake +++ b/cmake/conformal_ideal_delaunay.cmake @@ -6,3 +6,5 @@ FetchContent_Declare( GIT_TAG penner_optimization ) FetchContent_MakeAvailable(conformal_ideal_delaunay) +target_compile_features(conformal_cpp PRIVATE cxx_std_20) + diff --git a/cmake/directional.cmake b/cmake/directional.cmake index b971b82..95197a4 100644 --- a/cmake/directional.cmake +++ b/cmake/directional.cmake @@ -3,6 +3,7 @@ FetchContent_Declare( directional SYSTEM GIT_REPOSITORY https://github.com/avaxman/Directional.git + GIT_TAG v2.0.0 ) FetchContent_MakeAvailable(directional) diff --git a/cmake/libigl.cmake b/cmake/libigl.cmake index 84f338f..c4fa1fb 100644 --- a/cmake/libigl.cmake +++ b/cmake/libigl.cmake @@ -9,4 +9,4 @@ include(FetchContent) GIT_REPOSITORY https://github.com/libigl/libigl.git GIT_TAG v2.4.0 ) -FetchContent_MakeAvailable(libigl) \ No newline at end of file +FetchContent_MakeAvailable(libigl) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 470c9a6..a975307 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,4 +29,4 @@ if(FALSE) set_target_properties(penner PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}" ) -endif() \ No newline at end of file +endif() diff --git a/src/holonomy/field/facet_field.cpp b/src/holonomy/field/facet_field.cpp index e518a31..e97c79b 100644 --- a/src/holonomy/field/facet_field.cpp +++ b/src/holonomy/field/facet_field.cpp @@ -607,7 +607,7 @@ else { is >> id[0] >> id[1] >> id[2] >> m[0] >> m[1] >> m[2]; if (load_sharp) is >> sh[0] >> sh[1] >> sh[2]; if (!fin || !is) { - spdlog::error("{} facet {}: unable to read matchings. File partially loaded.", fname); + spdlog::error("{} facet {}: unable to read matchings. File partially loaded.", fname, i); return empty_output; } diff --git a/src/holonomy/field/intrinsic_field.cpp b/src/holonomy/field/intrinsic_field.cpp index 38c7da7..6c4de3c 100644 --- a/src/holonomy/field/intrinsic_field.cpp +++ b/src/holonomy/field/intrinsic_field.cpp @@ -1931,7 +1931,7 @@ void IntrinsicNRosyField::fix_cone_pair(const Mesh& m) if (cones[vi] < 4) pos_cone = vi; } int size = (4 - cones[pos_cone]); - spdlog::info("Fixing cone pair at {} and {} of size {}", pos_cone, neg_cone); + spdlog::info("Fixing cone pair at {} and {} of size {}", pos_cone, neg_cone, size); // move curvature move_cone(m, pos_cone, neg_cone, size); diff --git a/src/optimization/parameterization/layout.cpp b/src/optimization/parameterization/layout.cpp index 4d97bfc..7ea5a78 100644 --- a/src/optimization/parameterization/layout.cpp +++ b/src/optimization/parameterization/layout.cpp @@ -235,7 +235,7 @@ Scalar triangle_area( int hij) { int hjk = m.n[hij]; - int hli = prev_halfedge(m, hij); + int hli = prev_halfedge(dynamic_cast&>(m), hij); Eigen::Vector2d A = {u[hli], v[hli]}; Eigen::Vector2d B = {u[hij], v[hij]}; Eigen::Vector2d C = {u[hjk], v[hjk]}; @@ -278,8 +278,8 @@ Scalar compute_uv_length_error( int hji = m.opp[hij]; // get other halfedges in the face for vertex computation - int hki = prev_halfedge(m, hij); - int hlj = prev_halfedge(m, hji); + int hki = prev_halfedge(dynamic_cast&>(m), hij); + int hlj = prev_halfedge(dynamic_cast&>(m), hji); // get uv vertices on the edge Eigen::Vector2d uv0i = {u[hki], v[hki]}; diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index e644b35..007cb0f 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -23,6 +23,7 @@ target_link_libraries(PennerUtilLib PUBLIC ${SUITESPARSE_LIBS} ${POLYSCOPE_LIBRARIES} ) +target_compile_features(PennerUtilLib PUBLIC cxx_std_17) target_compile_definitions(PennerUtilLib PUBLIC SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_DEBUG