Skip to content

Commit 2df3eb4

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. This is fixed on current CGAL master. See: CGAL/cgal#8876
1 parent fe354e0 commit 2df3eb4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ 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_CXX_COMPILER_ID STREQUAL "GNU" AND
10+
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0 AND
11+
CGAL_VERSION VERSION_LESS 6.0.2)
12+
set(ALPHAWRAP_SRC ${CMAKE_SOURCE_DIR}/src/algorithm/alphaWrapping3D.cpp)
13+
list(FIND SFCGAL_SOURCES ${ALPHAWRAP_SRC} ALPHA_WRAPPING_INDEX)
14+
if (ALPHA_WRAPPING_INDEX GREATER_EQUAL 0)
15+
# With inline enabled CGAL::alpha_wrap_3 may segfault with GCC 15
16+
# See: https://github.com/CGAL/cgal/issues/8876
17+
set_source_files_properties(${ALPHAWRAP_SRC} PROPERTIES COMPILE_OPTIONS "-fno-inline")
18+
endif()
19+
endif()
20+
921
file( GLOB_RECURSE SFCGAL_HEADERS_COPIED RELATIVE ${CMAKE_SOURCE_DIR}/src "*.h" )
1022
add_custom_target(copy)
1123
foreach (header ${SFCGAL_HEADERS_COPIED})

0 commit comments

Comments
 (0)