From 8d26dda40c768d3ae5f662d2ab8bd341903c1c20 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 17 Aug 2023 13:45:11 +1000 Subject: [PATCH] Fix #111186: Crash backtrace missing on Linux Regression in [0] which caused `execinfo.h` not to be detected by CMake. Setting a default variable for other platforms prevented the new variable from being set. [0]: f197b1a1f1bbc0334310fb1c911327246767a1a3 --- build_files/cmake/have_features.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build_files/cmake/have_features.cmake b/build_files/cmake/have_features.cmake index 45358b31cff..de90d7fcdd2 100644 --- a/build_files/cmake/have_features.cmake +++ b/build_files/cmake/have_features.cmake @@ -16,15 +16,16 @@ check_symbol_exists(malloc_stats "malloc.h" HAVE_MALLOC_STATS_H) # Used for: `source/creator/creator_signals.c`. # The function `feenableexcept` is not present non-GLIBC systems, # hence we need to check if it's available in the `fenv.h` file. -set(HAVE_FEENABLEEXCEPT OFF) if(CMAKE_SYSTEM_NAME STREQUAL "Linux") check_symbol_exists(feenableexcept "fenv.h" HAVE_FEENABLEEXCEPT) endif() +if(NOT DEFINED HAVE_FEENABLEEXCEPT) + set(HAVE_FEENABLEEXCEPT 0) +endif() # Used for: `source/blender/blenlib/intern/system.c`. # `execinfo` is not available on non-GLIBC systems (at least not on MUSL-LIBC), # so check the presence of the header before including it and using the it for back-trace. -set(HAVE_EXECINFO_H OFF) if(NOT MSVC) include(CheckIncludeFiles) check_include_files("execinfo.h" HAVE_EXECINFO_H) @@ -32,3 +33,6 @@ if(NOT MSVC) add_definitions(-DHAVE_EXECINFO_H) endif() endif() +if(NOT DEFINED HAVE_EXECINFO_H) + set(HAVE_EXECINFO_H 0) +endif()