build(ninja): add ninja support

- Added ninja build support
- Updated readme
This commit is contained in:
Kristofers Solo 2024-03-10 18:58:51 +02:00
parent 42d1f3b908
commit 5faf18d03a
2 changed files with 45 additions and 6 deletions

29
.gitignore vendored
View File

@ -68,6 +68,35 @@ build
# Clang
.cache
# clangd
/.clangd/
/compile_commands.json
/.cache/
# Ninja output
.ninja_deps
.ninja_log
*.pyc
*.obj
*.ilk
/build*/
/build.ninja
/ninja
/ninja.bootstrap
/build_log_perftest
/canon_perftest
/clparser_perftest
/depfile_parser_perftest
/hash_collision_bench
/ninja_test
/manifest_parser_perftest
/graph.png
/doc/manual.html
/doc/doxygen
*.patch
.DS_Store
input.txt
output.txt

View File

@ -4,11 +4,11 @@
This is a simple C++ project that includes the function for our colleagues to
test. The function (i.e., the main function and the subfunctions used in it) is
located in `main_lib.cpp`.
located in `lib.cpp`.
## Additional libraries and executable
Our library `Prep` is concerned with preparation of data prior to the function
Our library `prep` is concerned with preparation of data prior to the function
call. `test.cpp` is a single test file that will contain the tests of our colleagues
and our own development tests. GTest is used for tests.
@ -18,12 +18,22 @@ and our own development tests. GTest is used for tests.
Compilation on Linux requires cmake and CXX compiler (e.g., g++).
### ninja
```bash
cd src
mkdir build
cmake -Gninja -Bbuild
cd build
cmake ../
cmake --build .
ninja
./main
```
### Make
```bash
cmake -Bbuild
cd build
make
./main
```
Resulting binaries are `build/main` - the program and `build/runtests` to