From 9d58b5e8c690dc72b13d786335ea2c527bc71ef7 Mon Sep 17 00:00:00 2001 From: Alok Meshram Date: Wed, 29 May 2024 10:18:23 -0700 Subject: [PATCH] Explicitly specified C++17 for libslic3r and libslic3r_cgal in cmake . Also excluded template-id-cdtor from Werror. These changes fix compilation issues on Fedora 40. --- src/clipper2/CMakeLists.txt | 2 +- src/libslic3r/CMakeLists.txt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/clipper2/CMakeLists.txt b/src/clipper2/CMakeLists.txt index 275f9273b..0dc24e5ca 100644 --- a/src/clipper2/CMakeLists.txt +++ b/src/clipper2/CMakeLists.txt @@ -37,7 +37,7 @@ target_include_directories(Clipper2 if (WIN32) target_compile_options(Clipper2 PRIVATE /W4 /WX) else() - target_compile_options(Clipper2 PRIVATE -Wall -Wextra -Wpedantic -Werror) + target_compile_options(Clipper2 PRIVATE -Wall -Wextra -Wpedantic -Werror -Wno-error=template-id-cdtor) target_link_libraries(Clipper2 PUBLIC -lm) endif() diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index ccf30d842..228e53ff7 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -456,6 +456,11 @@ if (_opts) target_compile_options(libslic3r_cgal PRIVATE "${_opts_bad}") endif() +set_property(TARGET libslic3r PROPERTY CXX_STANDARD 17) +set_property(TARGET libslic3r PROPERTY CXX_EXTENSIONS OFF) +set_property(TARGET libslic3r_cgal PROPERTY CXX_STANDARD 17) +set_property(TARGET libslic3r_cgal PROPERTY CXX_EXTENSIONS OFF) + target_link_libraries(libslic3r_cgal PRIVATE ${_cgal_tgt} libigl mcut) if (MSVC AND "${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") # 32 bit MSVC workaround