maze-thing/CMakeLists.txt

20 lines
612 B
CMake

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()
find_package(X11 REQUIRED)
target_link_libraries(maze-thing PRIVATE X11::X11)