feat: Add flags to deps for sanitizer builds (#2205)

Fix: https://github.com/XRPLF/clio/issues/2198
Tested in #2208
This commit is contained in:
Alex Kremer
2025-06-11 16:26:09 +01:00
committed by GitHub
parent 6e0d7a0fac
commit 35c90e64ec

View File

@@ -2,14 +2,17 @@
{% set sanitizer_opt_map = {'asan': 'address', 'tsan': 'thread', 'ubsan': 'undefined'} %}
{% set sanitizer = sanitizer_opt_map[sani] %}
{% set sanitizer_build_flags = "-fsanitize=" ~ sanitizer ~ " -g -O1 -fno-omit-frame-pointer" %}
{% set sanitizer_link_flags = "-fsanitize=" ~ sanitizer %}
include({{ compiler }})
[options]
boost/*:extra_b2_flags="cxxflags=\"-fsanitize={{ sanitizer }}\" linkflags=\"-fsanitize={{ sanitizer }}\""
boost/*:without_stacktrace=True
boost/*:extra_b2_flags = "cxxflags=\"{{ sanitizer_build_flags }}\" linkflags=\"{{ sanitizer_link_flags }}\""
boost/*:without_stacktrace = True
[conf]
tools.build:cflags+=["-fsanitize={{ sanitizer }}"]
tools.build:cxxflags+=["-fsanitize={{ sanitizer }}"]
tools.build:exelinkflags+=["-fsanitize={{ sanitizer }}"]
tools.build:cflags += ["{{ sanitizer_build_flags }}"]
tools.build:cxxflags += ["{{ sanitizer_build_flags }}"]
tools.build:exelinkflags += ["{{ sanitizer_link_flags }}"]
tools.build:sharedlinkflags += ["{{ sanitizer_link_flags }}"]