From 5faf18d03a563d02ce1ffcb6275ff344721fcabd Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Sun, 10 Mar 2024 18:58:51 +0200 Subject: [PATCH] build(ninja): add ninja support - Added ninja build support - Updated readme --- .gitignore | 29 +++++++++++++++++++++++++++++ README.md | 22 ++++++++++++++++------ 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 123517b..c6a6574 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/README.md b/README.md index e2205b6..c3a10e5 100644 --- a/README.md +++ b/README.md @@ -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