How to use compiler sanitizers, especially the address sanitizer in Conan2? Searching on Google, the only result found is for version 1, which does not work on 2. I tried the profile below, but without success.
include(default)
[settings]
arch=wasm
os=Emscripten
compiler.sanitizer=Address
[tool_requires]
*: emsdk/3.1.44
[env]
CFLAGS=-fsanitize=address
CXXFLAGS=-fsanitize=address
LDFLAGS=-fsanitize=address
And:
[compiler_flags]
sanitizer=Address
Conan says that env or compiler_flags is not a recognized section.
To add custom flags to compiler and linker in conan v2:
If you want that these flags contribute to package id, add this to
~/.conan2/global.conf
: