build: Improve build system (#327)

* *Add top level CMakeLists.txt, to make it easier to use both independently and from within other projects
* Add a unit_test target, to attach all unit tests to

* * Fix unit tests for windows
* Silence cmake warning regarding missing top project
* update .gitignore for vscode

---------

Co-authored-by: BobSmun <6492115+BobSmun@users.noreply.github.com>
This commit is contained in:
BobSmun
2024-12-17 03:37:38 +08:00
committed by GitHub
parent 63504f59a1
commit e026ff187e
7 changed files with 53 additions and 30 deletions

View File

@@ -51,7 +51,6 @@ jobs:
- name: 🛠️ Build
run: |
cd tests
mkdir -p build
cd build
CC=gcc-12 CXX=g++-12 cmake \
@@ -59,14 +58,15 @@ jobs:
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_FLAGS="-fuse-ld=lld --coverage" \
-DCMAKE_CXX_FLAGS="-fuse-ld=lld --coverage" \
-DIMHEX_PATTERNS_ENABLE_UNIT_TESTS=ON \
-DLIBPL_ENABLE_TESTS=OFF \
-DLIBPL_ENABLE_CLI=OFF \
..
make -j4
make -j4 unit_tests
- name: 🧪 Perform Unit Tests
run: |
cd tests/build
cd build
ctest --output-on-failure -j 4
- name: 📎 Validate JSON Files