cmake_minimum_required(VERSION 3.0) project(insane_dns) option(ENABLE_ADDRSAN "Enable the address sanitizer" OFF) option(ENABLE_UBSAN "Enable the ub sanitizer" OFF) option(ENABLE_TSAN "Enable the thread data race sanitizer" OFF) set(CMAKE_CXX_STANDARD 20) add_subdirectory(libraries/BLT) include_directories(include/) include_directories(libraries/asio-1.28.1/include) file(GLOB_RECURSE PROJECT_BUILD_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") #file(GLOB_RECURSE ASIO_BUILD_FILES "${CMAKE_CURRENT_SOURCE_DIR}/libraries/asio-1.28.1/src/*.cpp") #add_compile_definitions(ASIO_SEPARATE_COMPILATION) add_executable(insane_dns ${PROJECT_BUILD_FILES}) target_link_libraries(insane_dns BLT) target_compile_options(insane_dns PRIVATE -Wall -Werror -Wpedantic -Wno-comment -Wno-format) target_link_options(insane_dns PRIVATE -Wall -Werror -Wpedantic -Wno-comment -Wno-format) if (${ENABLE_ADDRSAN} MATCHES ON) target_compile_options(${PROJECT_NAME} PRIVATE -fsanitize=address) target_link_options(${PROJECT_NAME} PRIVATE -fsanitize=address) endif () if (${ENABLE_UBSAN} MATCHES ON) target_compile_options(${PROJECT_NAME} PRIVATE -fsanitize=undefined) target_link_options(${PROJECT_NAME} PRIVATE -fsanitize=undefined) endif () if (${ENABLE_TSAN} MATCHES ON) target_compile_options(${PROJECT_NAME} PRIVATE -fsanitize=thread) target_link_options(${PROJECT_NAME} PRIVATE -fsanitize=thread) endif ()