Add bootstrap.sh script for setting up the project build #15

Merged
daviwil merged 1 commits from daviwil/mesche:bootstrap-script into master 2023-06-03 12:32:54 +00:00
6 changed files with 21 additions and 7 deletions

5
.gitignore vendored
View File

@ -2,4 +2,7 @@ bin/
build/
deps/
tools/
.ccls-cache/
.cache/
.ccls-cache/
compile_commands.json
*~

View File

@ -2,9 +2,8 @@ pipeline:
build:
image: rikorose/gcc-cmake
commands: |
mkdir build
./bootstrap.sh ReleaseWithDeb
cd build
cmake -DCMAKE_BUILD_TYPE=ReleaseWithDeb ..
make
make test

View File

@ -6,5 +6,8 @@ set(CMAKE_C_STANDARD 99)
enable_testing()
# Generate compiler_commands.json for language server support
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_subdirectory(components/compiler)
add_subdirectory(components/cli)

View File

@ -23,9 +23,8 @@ It is used as a high-performance scripting language to drive C applications and
#+begin_src sh
git clone https://codeberg.org/mesche/mesche
mkdir build
./bootstrap.sh
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make
# Run the REPL!

11
bootstrap.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
# Run this script every time you clone or sync the repository so that
# your makefiles and compile_commands.json are up to date.
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=${1:-Debug} ..
# Make sure language servers can find compile_commands.json
cp compile_commands.json ..

View File

@ -26,9 +26,8 @@ To build the project, you need to clone the [[https://codeberg.org/mesche/mesche
#+begin_src sh
mkdir build
./bootstrap.sh
cd build
cmake ..
make
./components/cli/mesche repl