mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
libuavcan build: cppcheck made optional
This commit is contained in:
parent
481086f2c7
commit
da62126ca2
@ -19,9 +19,9 @@ Despite the fact that the library itself can be used on virtually any platform t
|
||||
Prerequisites:
|
||||
|
||||
* Google test library for C++ - gtest
|
||||
* Static analysis tool for C++ - cppcheck
|
||||
* C++03 *and* C++11 capable compiler with GCC-like interface (e.g. GCC, Clang)
|
||||
* CMake 2.8+
|
||||
* Optional: static analysis tool for C++ - cppcheck
|
||||
|
||||
Building the debug version, running the unit tests and the static analyzer:
|
||||
```bash
|
||||
|
||||
@ -98,7 +98,7 @@ function(add_libuavcan_test name library flags) # Adds GTest executable and crea
|
||||
endfunction()
|
||||
|
||||
if (DEBUG_BUILD)
|
||||
message(STATUS "Debug build (note: requires gtest, cppcheck)")
|
||||
message(STATUS "Debug build (note: requires gtest)")
|
||||
|
||||
if (COMPILER_IS_GCC_COMPATIBLE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic")
|
||||
@ -123,9 +123,6 @@ if (DEBUG_BUILD)
|
||||
add_libuavcan_test(libuavcan_test uavcan "") # Default
|
||||
add_libuavcan_test(libuavcan_test_cpp03 uavcan_cpp03 ${cpp03_flags}) # C++03
|
||||
add_libuavcan_test(libuavcan_test_optim uavcan_optim ${optim_flags}) # Max optimization
|
||||
|
||||
# Static analysis with cppcheck, both library and unit test sources
|
||||
add_custom_command(TARGET uavcan POST_BUILD COMMAND ./cppcheck.sh WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
else ()
|
||||
message(STATUS "Release build type: " ${CMAKE_BUILD_TYPE})
|
||||
endif ()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user