Skip to content

Commit dfbde03

Browse files
committed
Add build instructions and CI
1 parent ff695bf commit dfbde03

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

.github/workflows/c-cpp.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v3
16-
- name: make test
17-
working-directory: ./cpp
18-
run: make test
16+
- name: Configure CMake
17+
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
18+
- name: Build
19+
run: cmake --build build
20+
- name: Test
21+
working-directory: ./build
22+
run: ./test

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,25 @@ If you wish to be added to the list of known products/educational projects using
5454
* Lighthouses AI contest https://github.com/marcan/lighthouses_aicontest
5555
* Self-Driving Car Engineer Nanodegree Program https://github.com/vanAken/CarND-Path-Planning-Project
5656

57-
### Compilation
57+
### Building
5858

59-
Enter the cpp folder and run make
59+
Generally you can just include the stlastar.h and, optionally, the fsa.h header files and use it directly. The build instructions below are purely for the test suite and example executables.
6060

61-
#### Introduction
61+
#### Using CMake
6262

63-
This implementation is intended to be simple to read yet fairly
64-
efficient. To build it you can compile, with any recent C++ compiler,
65-
the following files :
63+
Some examples:
6664

67-
For 8-puzzle solver
65+
** Use make and make a debug build **
66+
```bash
67+
cmake -S . -B builddebug -DCMAKE_BUILD_TYPE=debug
68+
```
6869

69-
* 8puzzle.cpp
70-
* stlastar.h
71-
* optionally fsa.h
70+
** Use Ninja and make a Release build **
71+
```bash
72+
cmake -S . -B ninjabuildrelease -DCMAKE_BUILD_TYPE=release
73+
```
74+
75+
In both cases you can execute the build using `make -C [build folder]` or `ninja -C [build folder]`.
7276

7377
#### Command line
7478

@@ -99,4 +103,4 @@ it if you hit an out of memory assert during the search.
99103

100104
Compatibility notes:
101105

102-
This version of the code requires any standards compliant C++ using std C++11
106+
This version of the code requires any standards compliant C++ using std C++11. To build it requires a minimum cmake version you can find in the `CMakeLists.txt` file.

0 commit comments

Comments
 (0)