Build binary addon with address sanitizer



Hi all, I am learning how to build a VFS addon for Kodi. It successfully loads, but Kodi crashes with a segmentation fault. So, I want to build my addon with address sanitizer to try to find the problem.

I found this: https://github.com/xbmc/xbmc/blob/eb2939…zers.cmake

.. but I am not sure how to use this in my project. It is my first time using CMakeLists and C++..

This is my current CMakeLists.txt (based on https://alwinesch.github.io/group__cpp__cmake.html):

Code:

cmake_minimum_required(VERSION 3.10)
project(vfs.s3)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR})
find_package(Kodi REQUIRED)
find_package(aws-cpp-sdk-core REQUIRED)
find_package(aws-cpp-sdk-s3 REQUIRED)
include_directories(${KODI_INCLUDE_DIR})
set(DEPLIBS aws-cpp-sdk-core aws-cpp-sdk-s3)
set(S3_SOURCES src/main.cpp)
set(S3_HEADERS src/main.h)
build_addon(vfs.s3 S3 DEPLIBS)
include(CPack)

I currently build with: cmake . && make -j8 && sudo make install

And tips or links to documentation are very welcome!