mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 07:33:33 +08:00
RPi: add clang & clang-check support
This commit is contained in:
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
COMPILE_DB=$(/bin/pwd)/build_posix_rpi_cross;
|
||||
BIN=${RPI_TOOLCHAIN_DIR}/gcc-linaro-arm-linux-gnueabihf-raspbian/bin
|
||||
|
||||
CXX_INC=$(cd ${RPI_TOOLCHAIN_DIR}/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/include/c++/*; pwd)
|
||||
|
||||
EXTRA_ARG1=-I${CXX_INC}
|
||||
EXTRA_ARG2=-I${CXX_INC}/arm-linux-gnueabihf
|
||||
EXTRA_ARG3=-I${CXX_INC}/backward
|
||||
|
||||
grep file ${COMPILE_DB}/compile_commands.json |
|
||||
awk '{ print $2; }' |
|
||||
sed 's/\"//g' |
|
||||
while read FILE; do
|
||||
(cd $(dirname ${FILE});
|
||||
${BIN}/clang-check -analyze -p ${COMPILE_DB} --extra-arg=${EXTRA_ARG1} --extra-arg=${EXTRA_ARG2} --extra-arg=${EXTRA_ARG3} $(basename ${FILE})
|
||||
);
|
||||
done
|
||||
Reference in New Issue
Block a user