Commit ded25f9
committed
build: check backtrace in libc before searching for execinfo
Use cc.has_function('backtrace', prefix: '#include <execinfo.h>') to check
if backtrace is already available in the default system libraries (such as
glibc on Linux or natively on macOS). If it is available, use a dummy dependency.
Otherwise, fall back to cc.find_library('execinfo', required: false). This prevents
spurious compile or linker failures for unnecessary '-lexecinfo' links on macOS
and other platforms.1 parent 4edc45b commit ded25f9
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| |||
0 commit comments