docs(lv): add windows and mocos compilation instructions

This commit is contained in:
Kristofers Solo 2024-03-12 13:33:03 +02:00
parent dccdf82224
commit 48201b5946
2 changed files with 32 additions and 5 deletions

View File

@ -16,14 +16,31 @@ un mūsu pašu izstrādes testi. GTest tiek izmantots testiem.
## Lietojums
## Kompilācija
## Kompilācija uz Linux un MacOS
Kompilācijai operētājsistēmā Linux ir nepieciešams cmake un CXX kompilators (e.g., g++).
### MacOS
MacOS nepieciešama atsevišķi instalēt `gcc13`.
#### Izmantojot [Homebrew](https://brew.sh/)
```bash
brew install cmake gcc@13
brew install ninja # opcionāli
```
### Linux
Jūs zināt, ko darīt.
### ninja
```bash
cmake -G Ninja -B build
# vai
# cmake -G Ninja -B build -D CMAKE_CXX_COMPILER=g++-13 # MacOS
cd build
ninja
./main
@ -33,10 +50,19 @@ ninja
```bash
cmake -B build
# or
# cmake -B build -D CMAKE_CXX_COMPILER=g++-13 # for MacOS
cd build
make
./main
```
### Windows un/vai VSCode
Uzstādiet [CMake](https://cmake.org/download/) un VSCode [CMake Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) paplašinājumu.
- Atveriet projektu kā saknes direktoriju VSCode.
- Izvēlaties **View->Command palete...** vai `Ctrl+Shift+P` un palaidiet `CMake: Build`.
Rezultātā iegūtie binārie faili ir `build/main` - programma un `build/runtests`, lai
palaistu punktos norādītos testus iekš `test.cpp`.

View File

@ -26,6 +26,8 @@ Compilation on Linux and MacOS requires cmake and CXX compiler (e.g., g++).
MacOS require a separate installation of `gcc13`.
#### Using [Homebrew](https://brew.sh/)
```bash
brew install cmake gcc@13
brew install ninja # optional
@ -59,10 +61,9 @@ make
### Windows and/or VSCode
Install [CMake](https://cmake.org/download/) and VSCode [CMake Tools extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools).
Install [CMake](https://cmake.org/download/) and VSCode [CMake Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) extension.
- Open project as root in VSCode.
- Open **View->Command palette...** or `Ctrl+Shift+P` and run `CMake: Build`.
- Press **View->Command palette...** or `Ctrl+Shift+P` and run `CMake: Build`.
Resulting binaries are `build/main` -- the program and `build/runtests` to
run tests specified in `test.cpp`.
Resulting binaries are `build/main` -- the program and `build/runtests` to run tests specified in `test.cpp`.