cmake_minimum_required(VERSION 3.10) project(maze-thing LANGUAGES C) option(SANITIZERS "Enable undefined behaviour and address sanitizers" ON) add_executable(maze-thing main.c) set_property(TARGET maze-thing PROPERTY C_STANDARD 11) set_property(TARGET maze-thing PROPERTY C_EXTENSIONS OFF) target_compile_options(maze-thing PRIVATE -Wall -Wextra -pedantic) if(${SANITIZERS}) target_compile_options(maze-thing PRIVATE -fsanitize=address,undefined) target_link_options(maze-thing PRIVATE -fsanitize=address,undefined) endif()