27 lines
702 B
CMake
27 lines
702 B
CMake
cmake_minimum_required(VERSION 3.20)
|
|
project(advent_of_code_2023 C)
|
|
|
|
set(CMAKE_C_STANDARD 17)
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
set(CMAKE_BUILD_TYPE Release)
|
|
endif()
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall -Wextra -Wpedantic -Werror")
|
|
|
|
# Add address sanitizer on debug builds
|
|
if(CMAKE_BUILD_TYPE MATCHES Debug AND NOT WIN32)
|
|
add_compile_options(-fsanitize=address)
|
|
add_link_options(-fsanitize=address)
|
|
endif()
|
|
|
|
add_executable(day_01 day_1.c input_handler.c)
|
|
|
|
add_executable(day_02 day_2.c input_handler.c)
|
|
target_link_libraries(day_02 m)
|
|
|
|
add_executable(day_03 day_3.c input_handler.c)
|
|
|
|
add_executable(day_04 day_4.c input_handler.c)
|
|
|
|
add_executable(day_05 day_5.c input_handler.c map.c) |