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.

This commit is contained in:
Alok Meshram 2024-05-29 10:18:23 -07:00 committed by Lane.Wei
parent 60a792b76c
commit 9d58b5e8c6
2 changed files with 6 additions and 1 deletions

View File

@ -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()

View File

@ -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