updates to the sapphire.sh script
This commit is contained in:
parent
434405afb4
commit
af0fb223be
@ -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)
|
@ -7,13 +7,3 @@ add_custom_target(
|
||||
-i
|
||||
${ALL_SOURCE_FILES}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
clang-tidy
|
||||
COMMAND /usr/bin/clang-tidy
|
||||
${ALL_SOURCE_FILES}
|
||||
-config=''
|
||||
--
|
||||
-std=c++20
|
||||
-I${INCLUDE_DIRECTORIES}
|
||||
)
|
24
sapphire.sh
Executable file
24
sapphire.sh
Executable file
@ -0,0 +1,24 @@
|
||||
cd $(dirname $0)
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "Sapphire utility script"
|
||||
echo "-----------------------"
|
||||
echo "sapphire.sh build <config>: build the project"
|
||||
echo "sapphire.sh generate <generator>: regenerate build files"
|
||||
echo "sapphire.sh format: run clang-format on source files"
|
||||
echo "sapphire.sh clean: clean build files"
|
||||
echo "sapphire.sh install <path>: install the project"
|
||||
echo "sapphire.sh new-ast-node <name>: 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
|
@ -1,8 +1 @@
|
||||
if [ ! -d build ]
|
||||
then
|
||||
mkdir build
|
||||
fi
|
||||
|
||||
cmake -S . -B build -G ${1:-Ninja}
|
||||
|
||||
cmake --build build
|
||||
cmake --build build --config $1
|
6
tools/generate.sh
Executable file
6
tools/generate.sh
Executable file
@ -0,0 +1,6 @@
|
||||
if [ ! -d build ]
|
||||
then
|
||||
mkdir build
|
||||
fi
|
||||
|
||||
cmake -S . -B build -G "${1:-Ninja}"
|
8
tools/install.sh
Executable file
8
tools/install.sh
Executable file
@ -0,0 +1,8 @@
|
||||
cd build
|
||||
|
||||
if [ "$1" == "" ]
|
||||
then
|
||||
cmake --install .
|
||||
else
|
||||
cmake --install . --prefix $1
|
||||
fi
|
@ -1,9 +0,0 @@
|
||||
if [ ! -d build ]
|
||||
then
|
||||
mkdir build
|
||||
cmake -S . -B build
|
||||
fi
|
||||
|
||||
cd build
|
||||
|
||||
cmake --build . --target clang-tidy
|
Loading…
Reference in New Issue
Block a user