Advent of Code solutions using C99
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

30 lines
952 B

cmake_minimum_required(VERSION 3.10)
set(CMAKE_C_STANDARD 99)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_BUILD_TYPE Debug)
project(advent C)
add_subdirectory(lib/libflint)
file(GLOB SRC src/*.c)
file(GLOB SRC2015 src/2015/*.c)
file(GLOB SRC2016 src/2016/*.c)
file(GLOB SRC2017 src/2017/*.c)
file(GLOB SRC2018 src/2018/*.c)
file(GLOB SRC2019 src/2019/*.c)
file(GLOB SRC2020 src/2020/*.c)
file(COPY input DESTINATION ${CMAKE_BINARY_DIR})
add_executable(advent ${SRC} ${SRC2015} ${SRC2016} ${SRC2017} ${SRC2018} ${SRC2019} ${SRC2020})
if ((${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD"))
target_link_libraries(advent PRIVATE flint)
target_include_directories(advent PRIVATE include lib/libflint/include)
else()
find_package(OpenSSL REQUIRED)
target_link_libraries(advent PRIVATE bsd flint ${OPENSSL_LIBRARIES})
target_include_directories(advent PRIVATE include lib/libflint/include ${OpenSSL_INCLUDE_DIR})
endif()