mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 14:01:35 +08:00
Building tests only if GTest is found
This commit is contained in:
@@ -139,10 +139,15 @@ if (DEBUG_BUILD)
|
|||||||
add_dependencies(uavcan_optim libuavcan_dsdlc)
|
add_dependencies(uavcan_optim libuavcan_dsdlc)
|
||||||
|
|
||||||
# GTest executables
|
# GTest executables
|
||||||
find_package(GTest REQUIRED)
|
find_package(GTest)
|
||||||
add_libuavcan_test(libuavcan_test uavcan "") # Default
|
if (GTEST_FOUND)
|
||||||
add_libuavcan_test(libuavcan_test_cpp03 uavcan_cpp03 "${cpp03_flags}") # C++03
|
message(STATUS "GTest found, tests will be built and run [${GTEST_INCLUDE_DIRS}] [${GTEST_BOTH_LIBRARIES}]")
|
||||||
add_libuavcan_test(libuavcan_test_optim uavcan_optim "${optim_flags}") # Max optimization
|
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
|
||||||
|
else (GTEST_FOUND)
|
||||||
|
message(STATUS "GTest was not found, tests will not be built")
|
||||||
|
endif (GTEST_FOUND)
|
||||||
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