mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-08 18:50:34 +08:00
build: disable fuzztest when building with TSAN
fuzztest's coverage instrumentation is incompatible with Thread Sanitizer. Add px4_setup_gtest_without_fuzztest() macro to cmake/px4_add_gtest.cmake that fetches GTest standalone and stubs out fuzztest cmake functions. Guard all fuzztest-specific code on TARGET fuzztest::fuzztest so it compiles cleanly without fuzztest.
This commit is contained in:
+9
-5
@@ -1,8 +1,12 @@
|
||||
px4_add_git_submodule(TARGET git_fuzztest PATH "fuzztest")
|
||||
|
||||
message(STATUS "Adding fuzztest")
|
||||
# This will also add GTest
|
||||
add_subdirectory(fuzztest EXCLUDE_FROM_ALL)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "ThreadSanitizer")
|
||||
message(STATUS "TSAN build: skipping fuzztest, fetching GTest only")
|
||||
px4_setup_gtest_without_fuzztest()
|
||||
else()
|
||||
px4_add_git_submodule(TARGET git_fuzztest PATH "fuzztest")
|
||||
message(STATUS "Adding fuzztest")
|
||||
# This will also add GTest
|
||||
add_subdirectory(fuzztest EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
# Ensure there's no -R without any filter expression since that trips newer ctest versions
|
||||
if(TESTFILTER)
|
||||
|
||||
Reference in New Issue
Block a user