1 Star 1 Fork 1

chaotec/qcloud-iot-sdk-embedded-c

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
cmake_build.sh 2.20 KB
一键复制 编辑 原始数据 按行查看 历史
spikelin 提交于 2020-04-30 18:12 . v3.2.0
#! /bin/bash
if [ "$#" -eq "0" ]; then
rm -rf output
rm -rf build
echo "Build all (SDK libs and samples)"
mkdir -p build
cd build
cmake ..
make
exit
elif [ "$#" -eq "1" -a $1 == "samples" ]; then
if [ ! -d "output/release/bin" ]; then
rm -rf output/release/bin
elif [ ! -d "output/debug/bin" ]; then
rm -rf output/debug/bin
else
echo "Output folder not found! Please build SDK first"
exit
fi
rm -rf build
echo "Build samples only"
mkdir -p build
cd build
cmake -DSAMPLE_ONLY=ON ..
make
exit
elif [ "$#" -eq "1" -a $1 == "clean" ]; then
echo "Clean all (SDK lib and samples)"
rm -rf output
rm -rf build
exit
elif [ "$#" -eq "1" -a $1 == "code-check" ]; then
# code-check requires clang-tidy and cpplint
# sudo apt install clang-tidy
# pip install cpplint
echo "run code check"
rm -rf build
mkdir -p build
cd build
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
echo "clang-tidy check begin"
clang_extra_arg="-extra-arg=-I/usr/lib/gcc/x86_64-linux-gnu/7/include -extra-arg=-I/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed"
clang_check_rules="-checks=-clang-analyzer-osx*,-clang-analyzer-security.insecureAPI.strcpy,-clang-diagnostic-missing-braces,-clang-diagnostic-varargs"
../tools/run-clang-tidy ${clang_extra_arg} ${clang_check_rules} >../code-check-clang-tidy.txt
echo "clang-tidy check end"
echo "cpplint check begin"
cd ..
# find ./samples/ ./include/ ./sdk_src/ ./platform/ -name *.c -o -name *.h | xargs clang-format -i
cpplint_rules="--filter=-whitespace/line_length,-readability/casting,-build/include_subdir,-whitespace/braces,-whitespace/comments,-whitespace/blank_line,-whitespace/parens,-whitespace/semicolon,-whitespace/end_of_line,-whitespace/ending_newline,-whitespace/comma,-build/header_guard,-runtime/int,-runtime/printf,-readability/todo,-build/include_order,-build/include_what_you_use"
cpplint_coverage="include/ samples/ platform/ sdk_src/"
cpplint ${cpplint_rules} --recursive ${cpplint_coverage} &>./code-check-cpplint.txt
echo "cpplint check end"
exit
else
echo "Usage: "$0" <null for all/samples/clean/code-check>"
exit
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chaotec/qcloud-iot-sdk-embedded-c.git
git@gitee.com:chaotec/qcloud-iot-sdk-embedded-c.git
chaotec
qcloud-iot-sdk-embedded-c
qcloud-iot-sdk-embedded-c
master

搜索帮助