Modify clang tools usage.

This commit is contained in:
fancy 2023-11-24 05:58:00 -08:00
parent fb43de75ed
commit a0666c1311
5 changed files with 26 additions and 6 deletions

View File

@ -30,7 +30,10 @@ if ("${CLANG_TIDY_SUPPORT}" MATCHES "true")
set(CLANG_TIDY_EXE ${CLANG_TIDY_FIND} CACHE STRING INTERNAL) set(CLANG_TIDY_EXE ${CLANG_TIDY_FIND} CACHE STRING INTERNAL)
message("CLANG_TIDY_EXE = ${CLANG_TIDY_EXE}") message("CLANG_TIDY_EXE = ${CLANG_TIDY_EXE}")
else() else()
message(FATAL_ERROR "You set support clang-tidy, bug clang-tidy not found.") # message(FATAL_ERROR "See ${CMAKE_SOURCE_DIR_IPCSDK}/doc.")
message(FATAL_ERROR "You set support clang-tidy, but clang-tidy not found.
See file to install tools: ${IPC_SDK_PATH}/doc/clang-tidy_user_guide.md
Or modify: set(CLANG_TIDY_SUPPORT \"false\") to diable this function in file:${IPC_SDK_PATH}/builde/global_config.cmake")
endif() endif()
endif() endif()
# find the clang-format tools # find the clang-format tools

View File

@ -35,9 +35,9 @@ set(TEST_COVERAGE "true")
set(CURL_OPENSSL_LIB_SHARED_ENABLE "false") set(CURL_OPENSSL_LIB_SHARED_ENABLE "false")
# ------------ build curl + openssl end ------------ # # ------------ build curl + openssl end ------------ #
# ------------ build clang-tools ------------ # # ------------ build clang-tools ------------ #
set(CLANG_TIDY_SUPPORT "true") # set(CLANG_TIDY_SUPPORT "true")
set(CLANG_FORMAT_SUPPORT "true") # set(CLANG_FORMAT_SUPPORT "true")
set(LLVM_PATH "/home/xiaojiazhu/project/tmp/llvm-project") # set(LLVM_PATH "/home/xiaojiazhu/project/tmp/llvm-project")
# ------------ build clang-tools end ------------ # # ------------ build clang-tools end ------------ #
# ------------ build IpcConfig ------------ # # ------------ build IpcConfig ------------ #
set(IPC_CONFIG_FILE_PATH "./ipc_config") set(IPC_CONFIG_FILE_PATH "./ipc_config")

View File

@ -49,6 +49,13 @@ set(CLANG_TIDY_CONFIG "${CLANG_TIDY_CONFIG} -p ${CMAKE_SOURCE_DIR_IPCSDK}/cmake-
# set(CLANG_FORMAT_FILE "${CMAKE_SOURCE_DIR_IPCSDK}/tools/clang-format/.clang-format") # set(CLANG_FORMAT_FILE "${CMAKE_SOURCE_DIR_IPCSDK}/tools/clang-format/.clang-format")
set(CLANG_FORMAT_FILE "LLVM ${CMAKE_SOURCE_DIR_IPCSDK}/tools/clang-format/.clang-format") set(CLANG_FORMAT_FILE "LLVM ${CMAKE_SOURCE_DIR_IPCSDK}/tools/clang-format/.clang-format")
# -------------------------- clang-tidy tools end -------------------------- # # -------------------------- clang-tidy tools end -------------------------- #
# ------------ build clang-tools ------------ #
if(${LINUX_TEST} MATCHES "true")
set(CLANG_TIDY_SUPPORT "true")
set(CLANG_FORMAT_SUPPORT "true")
set(LLVM_PATH "/home/xiaojiazhu/project/tmp/llvm-project")
endif()
# ------------ build clang-tools end ------------ #
# -------------------------- log setting -------------------------- # # -------------------------- log setting -------------------------- #
function(define_file_name target) function(define_file_name target)

View File

@ -30,3 +30,13 @@ find ./ -name clang-tidy // 确认编译完成
``` ```
## 1.2. clang-tidy使用 ## 1.2. clang-tidy使用
修改配置:< IPC-SDK >/build/global_config.cmake
```
# ------------ build clang-tools ------------ #
if(${LINUX_TEST} MATCHES "true")
set(CLANG_TIDY_SUPPORT "true") // 使能工具
set(CLANG_FORMAT_SUPPORT "true")
set(LLVM_PATH "/home/xiaojiazhu/project/tmp/llvm-project") // llvm安装目录
endif()
# ------------ build clang-tools end ------------ #
```

View File

@ -19,7 +19,7 @@
2. PIR sensor 2. PIR sensor
3. IR leds 3. IR leds
4. 电池(箱体); 4. 电池(箱体);
5. 启动模式拨键(三键) 5. 单按键启动;
6. 按键:同步/复位/格式化; 6. 按键:同步/复位/格式化;
7. SD card 7. SD card
8. usb接口 8. usb接口