Skip to content

Latest commit

 

History

History
75 lines (60 loc) · 1.64 KB

README.md

File metadata and controls

75 lines (60 loc) · 1.64 KB

Advent of Code 2022 (C++)

My solutions to the Advent of Code 2022 (C++).

Installation

Requirements

  • CMake: required minimum version is 3.22.
  • conan.
  • gcc: this project has been tested with version 12.
  • git.
  • ninja.

From a terminal, as administrator:

$> sudo apt-get -qq update
$> sudo apt-get -qq upgrade
$> sudo apt-get -qq -y install \
       ccache \
       cmake \
       curl \
       g++-12 \
       gcc-12 \
       git \
       ninja-build \
       pkg-config \
       python3-pip
       tar \
       unzip \
       wget \
       zip
$> sudo pip install conan
$> sudo update-alternatives \
       --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 \
       --slave /usr/bin/g++ g++ /usr/bin/g++-12 \
       --slave /usr/bin/gcov gcov /usr/bin/gcov-12

Clone

From a terminal:

~/projects> git clone https://github.com/rturrado/aoc_2022

Build

The example below builds the project for the unixlike-gcc-debug-github Conan profile.

From a terminal:

~/projects/aoc_2022/> conan install . -if=cmake-build-unixlike-gcc-debug-github -pr=conan/profiles/unixlike-gcc-debug-github -b=missing
~/projects/aoc_2022/> conan build . -c -b -bf=cmake-build-unixlike-gcc-debug-github

Run

From a terminal:

~/projects/aoc_2022> ./cmake-build-unixlike-gcc-debug-github/bin/aoc_2022

Tests

Tests are built with the following Conan profiles:

  • unixlike-gcc-debug-tests.
  • unixlike-gcc-debug-github.
  • unixlike-gcc-release-tests.
  • unixlike-gcc-release-github.

From a terminal:

~/projects/aoc_2022> ./cmake-build-unixlike-gcc-debug-github/bin/aoc_2022_test