Codam / 42 webserv project
- C++ compiler (clang++ or g++) with C++20 support
- CMake 3.21 or higher
- create build folder
mkdir build && cd build
- generate build files
cmake ..
- compile project
cmake --build .
ormake
- run project
./webserv [config_file]
- generate build files with tests
cmake -DBUILD_TESTS=y ..
- compile project
cmake --build .
ormake
- run tests
ctest
- generate build files with AddressSanitizer
cmake -DCMAKE_BUILD_TYPE=Debug ..
- compile project
cmake --build .
ormake
Steps to prepare vscode for autoformatting:
- Install vscode extension: C/C++ IntelliSense (
ms-vscode.cpptools
) - Copy
.vscode/settings.json.default
to.vscode/settings.json
(this will apply the default settings for this project)
Use the following key combinations to format the file:
- Macos:
Option + Shift + F
to format the file - Linux:
Ctrl + Shift + I
to format the file
Dont forget to format files before commiting!
Steps to prepare vscode for better C++ syntax highlighting:
- Install vscode extension: C/C++ IntelliSense (
ms-vscode.cpptools
) - Copy
.vscode/c_cpp_properties.json.default
to.vscode/c_cpp_properties.json
(this will apply the default settings for this project)
To configure webserv, use the configuration file.