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