1
0
mirror of https://github.com/chylex/Advent-of-Code.git synced 2025-05-19 10:34:05 +02:00

Restructure project configuration (2015)

This commit is contained in:
chylex 2022-12-03 00:47:44 +01:00
parent c4d7d26bfd
commit ee22516eb6
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548
20 changed files with 51 additions and 79 deletions

9
.gitignore vendored
View File

@ -1,9 +0,0 @@
/.idea/compiler.xml
/.idea/dictionaries
/.idea/encodings.xml
/.idea/gradle.xml
/.idea/inspectionProfiles/
/.idea/jarRepositories.xml
/.idea/modules.xml
/.idea/vcs.xml
/.idea/*.iml

3
.idea/.gitignore vendored
View File

@ -1,3 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@ -1 +0,0 @@
AdventOfCode

View File

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$/2015">
<contentRoot DIR="$PROJECT_DIR$" />
</component>
<component name="CidrRootsConfiguration">
<sourceRoots>
<file path="$PROJECT_DIR$/2015" />
<file path="$PROJECT_DIR$/2020" />
</sourceRoots>
<excludeRoots>
<file path="$PROJECT_DIR$/.gradle" />
<file path="$PROJECT_DIR$/2020/target" />
<file path="$PROJECT_DIR$/2021" />
<file path="$PROJECT_DIR$/build" />
<file path="$PROJECT_DIR$/gradle" />
</excludeRoots>
</component>
<component name="CodeInsightWorkspaceSettings">
<option name="optimizeImportsOnTheFly" value="true" />
</component>
<component name="ComposerSettings">
<execution />
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="JsFlowSettings">
<service-enabled>true</service-enabled>
<exe-path />
<other-services-enabled>true</other-services-enabled>
<auto-save>true</auto-save>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.4" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK" />
</project>

View File

@ -1,7 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="2015 - Day 01" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$PROJECT_DIR$/2015/01" PASS_PARENT_ENVS_2="true" PROJECT_NAME="AOC" TARGET_NAME="AOC_2015_01" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="AOC" RUN_TARGET_NAME="AOC_2015_01">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

View File

@ -1,7 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="2015 - Day 02" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$PROJECT_DIR$/2015/02" PASS_PARENT_ENVS_2="true" PROJECT_NAME="AOC" TARGET_NAME="AOC_2015_02" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="AOC" RUN_TARGET_NAME="AOC_2015_02">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

View File

@ -1,7 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="2015 - Day 03" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$PROJECT_DIR$/2015/03" PASS_PARENT_ENVS_2="true" PROJECT_NAME="AOC" TARGET_NAME="AOC_2015_03" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="AOC" RUN_TARGET_NAME="AOC_2015_03">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

5
2015/.gitignore vendored
View File

@ -1,2 +1,7 @@
/.idea/*
!/.idea/cmake.xml
!/.idea/misc.xml
!/.idea/runConfigurations
/cmake-build-debug/
/cmake-build-release/

12
2015/.idea/misc.xml Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
<component name="CidrRootsConfiguration">
<sourceRoots>
<file path="$PROJECT_DIR$/01" />
<file path="$PROJECT_DIR$/02" />
<file path="$PROJECT_DIR$/03" />
<file path="$PROJECT_DIR$/utils" />
</sourceRoots>
</component>
</project>

View File

@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Day 01" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$PROJECT_DIR$/01" PASS_PARENT_ENVS_2="true" PROJECT_NAME="2015" TARGET_NAME="2015_01" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="2015" RUN_TARGET_NAME="2015_01">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

View File

@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Day 02" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$PROJECT_DIR$/02" PASS_PARENT_ENVS_2="true" PROJECT_NAME="2015" TARGET_NAME="2015_02" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="2015" RUN_TARGET_NAME="2015_02">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

View File

@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Day 03" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$PROJECT_DIR$/03" PASS_PARENT_ENVS_2="true" PROJECT_NAME="2015" TARGET_NAME="2015_03" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="2015" RUN_TARGET_NAME="2015_03">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

View File

@ -1,4 +1,4 @@
set(PROJECT_NAME AOC_2015_01)
set(PROJECT_NAME 2015_01)
project(${PROJECT_NAME} C ASM_NASM)

View File

@ -1,4 +1,4 @@
set(PROJECT_NAME AOC_2015_02)
set(PROJECT_NAME 2015_02)
project(${PROJECT_NAME} C ASM_NASM)

View File

@ -1,4 +1,4 @@
set(PROJECT_NAME AOC_2015_03)
set(PROJECT_NAME 2015_03)
project(${PROJECT_NAME} C ASM_NASM)

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.20)
project(AOC)
project(2015)
enable_language(ASM_NASM)

View File

@ -1,5 +1,5 @@
#ifndef ADVENTOFCODE_BENCHMARK_H
#define ADVENTOFCODE_BENCHMARK_H
#ifndef INC_2015_BENCHMARK_H
#define INC_2015_BENCHMARK_H
#include "stdio.h"
@ -64,4 +64,4 @@ void runBenchmark(const entryPointCallback ep, char* input) {
#undef BENCHMARK_RUNS
#endif //ADVENTOFCODE_BENCHMARK_H
#endif //INC_2015_BENCHMARK_H

View File

@ -1,5 +1,5 @@
#ifndef ADVENTOFCODE_FILE_H
#define ADVENTOFCODE_FILE_H
#ifndef INC_2015_FILE_H
#define INC_2015_FILE_H
#include "stdio.h"
#include "stdlib.h"
@ -65,4 +65,4 @@ char* readFile(const char* filename) {
return contents;
}
#endif //ADVENTOFCODE_FILE_H
#endif //INC_2015_FILE_H

View File

@ -24,7 +24,9 @@ The source code is in `main.rs`. The run configuration executes the `main()` fun
## \[2015\] NASM x64 Assembly
The repository contains a CMake project (`2015/CMakeLists.txt`) in the respective year's folder, which sets up every day as a CMake subproject. You should be able to load the CMake project into [CLion](https://www.jetbrains.com/clion/), as long as you have a toolchain named `Visual Studio x64` set to use the `amd64` architecture.
The repository contains a CMake project (`2015/CMakeLists.txt`) in the respective year's folder, which sets up every day as a CMake subproject.
You should be able to load the CMake project into [CLion](https://www.jetbrains.com/clion/), as long as you have a toolchain named `Visual Studio x64` set to use the `amd64` architecture.
The source code is in `main.c`, which is either in the puzzle's own folder, or in `utils` if no adjustments are needed. By default, `main.c` reads the whole input file into a buffer, and passes it as a parameter to the `entryPoint` function defined in `main.asm` which implements the logic and output of each puzzle.