Skip to content

Commit c1db6ea

Browse files
committed
chore(build): Disable inline on alpha wrapping with gcc 15
With inline enabled CGAL::alpha_wrap_3 may segfault with GCC 15. See: CGAL/cgal#8876
1 parent fe354e0 commit c1db6ea

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC )
66
list(REMOVE_ITEM SFCGAL_HEADERS ${CMAKE_SOURCE_DIR}/src/algorithm/alphaShapes.h)
77
endif()
88

9+
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0)
10+
set(ALPHAWRAP_SRC ${CMAKE_SOURCE_DIR}/src/algorithm/alphaWrapping3D.cpp)
11+
list(FIND SFCGAL_SOURCES ${ALPHAWRAP_SRC} ALPHA_WRAPPING_INDEX)
12+
if (ALPHA_WRAPPING_INDEX GREATER_EQUAL 0)
13+
# With inline enabled CGAL::alpha_wrap_3 may segfault with GCC 15
14+
# See: https://github.com/CGAL/cgal/issues/8876
15+
set_source_files_properties(${ALPHAWRAP_SRC} PROPERTIES COMPILE_OPTIONS "-fno-inline")
16+
endif()
17+
endif()
18+
919
file( GLOB_RECURSE SFCGAL_HEADERS_COPIED RELATIVE ${CMAKE_SOURCE_DIR}/src "*.h" )
1020
add_custom_target(copy)
1121
foreach (header ${SFCGAL_HEADERS_COPIED})

0 commit comments

Comments
 (0)