Added CPP Part
This commit is contained in:
parent
adb4497012
commit
3ce89fa056
10 changed files with 40 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
target
|
target
|
||||||
|
build
|
22
cpp/CMakeLists.txt
Normal file
22
cpp/CMakeLists.txt
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
cmake_minimum_required(VERSION 3.22)
|
||||||
|
# Global Variables
|
||||||
|
set(TARGET aoc2022)
|
||||||
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
|
# Set the etape value
|
||||||
|
set(DAY "1" CACHE STRING "Enter the day to compile.")
|
||||||
|
|
||||||
|
# Get the sources and headers
|
||||||
|
file(GLOB SOURCES "${PROJECT_SOURCE_DIR}/day${DAY}/src/*.cpp")
|
||||||
|
add_executable(${TARGET} ${SOURCES})
|
||||||
|
target_include_directories(${TARGET} PUBLIC "${PROJECT_SOURCE_DIR}/day${DAY}/include/")
|
||||||
|
|
||||||
|
# Adding compilation option depending on the OS
|
||||||
|
if(MSVC)
|
||||||
|
target_compile_options(${TARGET} PUBLIC /W3 /WX /DEBUG )
|
||||||
|
else()
|
||||||
|
target_compile_options(${TARGET} PUBLIC -Wall -Wextra -Wpedantic -Werror -lstdc++)
|
||||||
|
endif()
|
||||||
|
|
7
cpp/day1/src/main.cpp
Normal file
7
cpp/day1/src/main.cpp
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
std::cout << "Bonjour Monde!" << std::endl;
|
||||||
|
return 0;
|
||||||
|
}
|
5
cpp/run.bat
Normal file
5
cpp/run.bat
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
echo off
|
||||||
|
cmake --build build
|
||||||
|
cd build/Debug
|
||||||
|
aoc2022.exe
|
||||||
|
cd ../..
|
4
cpp/run.sh
Normal file
4
cpp/run.sh
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cmake --build build
|
||||||
|
"./build/aoc2022"
|
0
day1/Cargo.lock → rust/day1/Cargo.lock
generated
0
day1/Cargo.lock → rust/day1/Cargo.lock
generated
Loading…
Add table
Reference in a new issue