This commit is contained in:
Mylloon 2023-09-19 11:39:57 +02:00
parent e5c8c71c0f
commit bb10a715c3
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
7 changed files with 59 additions and 0 deletions

2
cpp/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*.o
example

3
cpp/.vscode/extensions.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"recommendations": ["llvm-vs-code-extensions.vscode-clangd"]
}

8
cpp/.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,8 @@
{
"editor.tabSize": 2,
"editor.insertSpaces": false,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true
}

26
cpp/Makefile Normal file
View file

@ -0,0 +1,26 @@
CXX = g++
CXXFLAGS = --std=c++11
RM = rm
SOURCES = $(wildcard src/*.cpp)
OBJETS = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES)))
EXE = example
%.cpp.o: src/%.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS) $(DEVFLAGS)
main: CXXFLAGS += -O3
main: compilation
dev: CXXFLAGS += -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -g -Wold-style-cast -Wsign-conversion
dev: compilation
compilation: $(OBJETS)
$(CXX) -o $(EXE) $(OBJETS)
all:
main
clean:
$(RM) $(OBJETS) $(EXE)

10
cpp/includes/Example.hpp Normal file
View file

@ -0,0 +1,10 @@
#ifndef PROJECT_EXAMPLE_HPP
#define PROJECT_EXAMPLE_HPP 1
#include <iostream>
struct Example {
Example();
};
#endif

3
cpp/src/Example.cpp Normal file
View file

@ -0,0 +1,3 @@
#include "../includes/Example.hpp"
Example::Example() { std::cout << "Hello, world!\n"; }

7
cpp/src/main.cpp Normal file
View file

@ -0,0 +1,7 @@
#include "../includes/Example.hpp"
int main(int argc, char const *argv[]) {
Example();
return 0;
}