diff --git a/CMakeLists.txt b/CMakeLists.txt index 2467337..7e71ff2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,4 +70,6 @@ target_link_libraries(sapphirec ${llvm_libs}) install(TARGETS sapphirec) +include_directories(src src/tclap-1.2.5/include) + include(cmake/clang-dev-tools.cmake) \ No newline at end of file diff --git a/build.sh b/build.sh deleted file mode 100755 index e69de29..0000000 diff --git a/cmake/clang-dev-tools.cmake b/cmake/clang-dev-tools.cmake index 5fdfbcf..ff5c827 100644 --- a/cmake/clang-dev-tools.cmake +++ b/cmake/clang-dev-tools.cmake @@ -6,14 +6,4 @@ add_custom_target( -style=file -i ${ALL_SOURCE_FILES} -) - -add_custom_target( - clang-tidy - COMMAND /usr/bin/clang-tidy - ${ALL_SOURCE_FILES} - -config='' - -- - -std=c++20 - -I${INCLUDE_DIRECTORIES} ) \ No newline at end of file diff --git a/sapphire.sh b/sapphire.sh new file mode 100755 index 0000000..ad8e739 --- /dev/null +++ b/sapphire.sh @@ -0,0 +1,24 @@ +cd $(dirname $0) + +usage() +{ + echo "Sapphire utility script" + echo "-----------------------" + echo "sapphire.sh build : build the project" + echo "sapphire.sh generate : regenerate build files" + echo "sapphire.sh format: run clang-format on source files" + echo "sapphire.sh clean: clean build files" + echo "sapphire.sh install : install the project" + echo "sapphire.sh new-ast-node : create a new AST node" +} + +case $1 in + "build") tools/build.sh "$2";; + "generate") tools/generate.sh "$2";; + "format") tools/format.sh;; + "clean") rm -rf build;; + "install") tools/install.sh "$2";; + "new-ast-node") tools/generateASTNode.sh $2;; + "help") usage;; + *) echo "Invalid action, run './sapphire.sh help' for a list of available options.";; +esac \ No newline at end of file diff --git a/tools/build.sh b/tools/build.sh index ca8a677..b879e7d 100755 --- a/tools/build.sh +++ b/tools/build.sh @@ -1,8 +1 @@ -if [ ! -d build ] -then - mkdir build -fi - -cmake -S . -B build -G ${1:-Ninja} - -cmake --build build \ No newline at end of file +cmake --build build --config $1 \ No newline at end of file diff --git a/tools/generate.sh b/tools/generate.sh new file mode 100755 index 0000000..fe045c0 --- /dev/null +++ b/tools/generate.sh @@ -0,0 +1,6 @@ +if [ ! -d build ] +then + mkdir build +fi + +cmake -S . -B build -G "${1:-Ninja}" \ No newline at end of file diff --git a/tools/install.sh b/tools/install.sh new file mode 100755 index 0000000..b147d08 --- /dev/null +++ b/tools/install.sh @@ -0,0 +1,8 @@ +cd build + +if [ "$1" == "" ] +then +cmake --install . +else +cmake --install . --prefix $1 +fi \ No newline at end of file diff --git a/tools/lint.sh b/tools/lint.sh deleted file mode 100755 index b4fbb14..0000000 --- a/tools/lint.sh +++ /dev/null @@ -1,9 +0,0 @@ -if [ ! -d build ] -then - mkdir build - cmake -S . -B build -fi - -cd build - -cmake --build . --target clang-tidy \ No newline at end of file