With ECM *not* installed:
mkdir buildcmake && cd buildcmake
cmake -GNinja ..
ninja
The build should be successful.
rm -rf *
cmake -GNinja .. -DECM_ENABLE_SANITIZERS=undefined
CMake should return en error:
ECM is required to enable the sanitizers
(https://api.kde.org/ecm/index.html)
Install ECM (instructions for Debian/Ubuntu):
sudo apt install extra-cmake-modules
Then
rm -rf *
cmake -GNinja .. -DECM_ENABLE_SANITIZERS=undefined
ninja -v
The build should enable the sanitizer (check the build commands for
`-fsanitize=undefined`)
rm -rf *
cmake -GNinja .. -DECM_ENABLE_SANITIZERS="address;leak"
Note: if you need to disable assembly instructions, add
`-DUSE_ASM_X86_64=OFF` to the CMake command line.
ninja -v
The build should enable the sanitizers (check the build commands for
`-fsanitize=address` and `-fsanitize=leak`)