format and lint tasks
This commit is contained in:
parent
723b74da13
commit
434405afb4
@ -68,4 +68,6 @@ llvm_map_components_to_libnames(llvm_libs support core irreader)
|
||||
# Link against LLVM libraries
|
||||
target_link_libraries(sapphirec ${llvm_libs})
|
||||
|
||||
install(TARGETS sapphirec)
|
||||
install(TARGETS sapphirec)
|
||||
|
||||
include(cmake/clang-dev-tools.cmake)
|
8
build.sh
8
build.sh
@ -1,8 +0,0 @@
|
||||
if [ ! -d build ]
|
||||
then
|
||||
mkdir build
|
||||
fi
|
||||
|
||||
cmake -S . -B build -G Ninja
|
||||
|
||||
cmake --build build
|
19
cmake/clang-dev-tools.cmake
Normal file
19
cmake/clang-dev-tools.cmake
Normal file
@ -0,0 +1,19 @@
|
||||
file(GLOB ALL_SOURCE_FILES src/*.cpp src/*.h src/AST/*.cpp src/AST/*.h)
|
||||
|
||||
add_custom_target(
|
||||
clang-format
|
||||
COMMAND /usr/bin/clang-format
|
||||
-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}
|
||||
)
|
8
tools/build.sh
Executable file
8
tools/build.sh
Executable file
@ -0,0 +1,8 @@
|
||||
if [ ! -d build ]
|
||||
then
|
||||
mkdir build
|
||||
fi
|
||||
|
||||
cmake -S . -B build -G ${1:-Ninja}
|
||||
|
||||
cmake --build build
|
9
tools/format.sh
Executable file
9
tools/format.sh
Executable file
@ -0,0 +1,9 @@
|
||||
if [ ! -d build ]
|
||||
then
|
||||
mkdir build
|
||||
cmake -S . -B build
|
||||
fi
|
||||
|
||||
cd build
|
||||
|
||||
cmake --build . --target clang-format
|
9
tools/lint.sh
Executable file
9
tools/lint.sh
Executable file
@ -0,0 +1,9 @@
|
||||
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