Build: resolve linking error on *BSD systems

Ref !144247
This commit is contained in:
Brad Smith
2025-09-02 04:04:20 +00:00
committed by Campbell Barton
parent 30837eca7c
commit c114a1f660

View File

@@ -774,6 +774,13 @@ if(WITH_OPENGL_BACKEND AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_link_libraries(bf_gpu PUBLIC rt)
endif()
# If `execinfo.h` exists on a *BSD system then also link in `libexecinfo`.
# Needed for `backtrace` / `backtrace_symbols` (GNU extensions)
# brought in by `blenlib/intern/system.cc`.
if(HAVE_EXECINFO_H AND CMAKE_SYSTEM_NAME MATCHES "FreeBSD|NetBSD|OpenBSD|DragonFly")
target_link_libraries(bf_gpu PUBLIC execinfo)
endif()
if(WITH_OPENSUBDIV)
target_link_libraries(bf_gpu PUBLIC bf_osd_shaders)
endif()