From d6ad197d3c8452cd4d2548813e0b88a333ce11d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Sun, 1 Dec 2024 02:45:23 -0500 Subject: [PATCH] cmake: look for rdynamic instead of hardcoding it (#699) --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2948e56db..68fc79060 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -296,8 +296,8 @@ endif() if(MSVC) target_compile_definitions(snmalloc INTERFACE -D_HAS_EXCEPTIONS=0) else() - # All symbols are always dynamic on haiku and -rdynamic is redundant (and unsupported). - if (NOT CMAKE_SYSTEM_NAME STREQUAL "Haiku") + check_linker_flag(CXX "-rdynamic" SNMALLOC_LINKER_SUPPORT_RDYNAMIC) + if (SNMALLOC_LINKER_SUPPORT_RDYNAMIC) # Get better stack traces in CI and debug builds. target_link_options(snmalloc INTERFACE $<${ci_or_debug}:-rdynamic>) endif()