Merge pull request #11 from jorenchik/macos-support

MacOS and Windows guide
This commit is contained in:
Jorens Shtekels 2024-03-12 13:35:31 +02:00 committed by GitHub
commit 6fdf800fbd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 55 additions and 11 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

@ -18,14 +18,31 @@ and our own development tests. GTest is used for tests.
## Usage
## Compilation
## Compilation on Linux and MacOS
Compilation on Linux requires cmake and CXX compiler (e.g., g++).
Compilation on Linux and MacOS requires cmake and CXX compiler (e.g., g++).
### MacOS
MacOS require a separate installation of `gcc13`.
#### Using [Homebrew](https://brew.sh/)
```bash
brew install cmake gcc@13
brew install ninja # optional
```
### Linux
You know what to do.
### ninja
```bash
cmake -G Ninja -B build
cmake -G Ninja -B
# or
# cmake -G Ninja -B build -D CMAKE_CXX_COMPILER=g++-13 # MacOS
cd build
ninja
./main
@ -35,17 +52,18 @@ ninja
```bash
cmake -B build
# or
# cmake -B build -D CMAKE_CXX_COMPILER=g++-13 # for MacOS
cd build
make
./main
```
Resulting binaries are `build/main` - the program and `build/runtests` to
run tests specified in `test.cpp`.
### Windows and/or VSCode
## TODOS
Install [CMake](https://cmake.org/download/) and VSCode [CMake Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) extension.
- [x] Translate README in Latvian
- [ ] Windows support
- [x] Check the compilation process on Windows
- [ ] Add compilation guide
- Open project as root in VSCode.
- 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`.