-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
85 additions
and
34 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
build | ||
src/2023/inputs | ||
src/2024/inputs | ||
inputs | ||
inputs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
################################################################################ | ||
# Preamble | ||
cmake_minimum_required(VERSION 3.21) | ||
|
||
project( | ||
aoc | ||
VERSION 0.0.2023 | ||
LANGUAGES CXX | ||
) | ||
|
||
message(STATUS "CMake build configuration for ${PROJECT_NAME} (${CMAKE_BUILD_TYPE}) ${PROJECT_VERSION}") | ||
|
||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${PROJECT_SOURCE_DIR}/cmake") | ||
|
||
set(CMAKE_CXX_STANDARD 23) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
################################################################################ | ||
# dependencies | ||
|
||
include(cmake/dependencies.cmake) | ||
|
||
################################################################################ | ||
# targets | ||
|
||
enable_testing() | ||
add_subdirectory(src) | ||
|
||
################################################################################ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
include(FetchContent) | ||
|
||
set(BENCHMARK_DOWNLOAD_DEPENDENCIES ON) | ||
set(BENCHMARK_ENABLE_TESTING OFF) | ||
# Fetch Google Benchmark | ||
FetchContent_Declare( | ||
benchmark | ||
GIT_REPOSITORY https://github.com/google/benchmark.git | ||
GIT_TAG v1.8.3 | ||
) | ||
|
||
FetchContent_MakeAvailable(benchmark) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
################################################################################ | ||
# build and add a standard test | ||
|
||
function(create_standard_test) | ||
set(prefix TEST) | ||
set(singleValues NAME WORKING_DIRECTORY YEAR) | ||
set(multiValues SOURCES LIBRARIES) | ||
|
||
include(CMakeParseArguments) | ||
cmake_parse_arguments(${prefix} " " "${singleValues}" "${multiValues}" ${ARGN}) | ||
|
||
if(NOT DEFINED TEST_YEAR) | ||
message(FATAL_ERROR "TEST_YEAR must be specified") | ||
endif() | ||
|
||
add_executable(test_${TEST_NAME} ${TEST_SOURCES}) | ||
|
||
set_target_properties(test_${TEST_NAME} PROPERTIES | ||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${TEST_YEAR}" | ||
) | ||
|
||
target_link_libraries(test_${TEST_NAME} PUBLIC benchmark ${TEST_LIBRARIES}) | ||
|
||
if(NOT DEFINED TEST_WORKING_DIRECTORY) | ||
set(TEST_WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/${TEST_YEAR}") | ||
endif() | ||
|
||
add_aoc_test(${TEST_NAME} test_${TEST_NAME} "" ${TEST_WORKING_DIRECTORY}) | ||
endfunction(create_standard_test) | ||
|
||
################################################################################ | ||
# Add a test | ||
|
||
function(add_aoc_test test_name test_binary test_args working_dir) | ||
add_test(NAME ${test_name} | ||
COMMAND ${test_binary} ${test_args} | ||
WORKING_DIRECTORY ${working_dir}) | ||
endfunction(add_aoc_test) | ||
|
||
################################################################################ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.