Files
allwpilib/cmake/modules/AddTest.cmake
Gold856 d4311d5a29 [wpiutil,glass,dlt] Replace libprotobuf with upb for dynamic decode (#7988)
libprotobuf is a very annoying dependency to deal with, and with the switch to nanopb for generated C++ code, libprotobuf is only used for dynamic decode in the GUI apps. libprotobuf has been swapped out with upb, a much smaller C-based library that supports reflection and can therefore do dynamic decode. This means we can remove the libprotobuf dependency and stop dealing with build issues because of it.
2025-08-16 22:56:32 -07:00

16 lines
538 B
CMake

include(CompileWarnings)
macro(wpilib_add_test name srcdir)
file(GLOB_RECURSE test_src ${srcdir}/*.cpp)
add_executable(${name}_test ${test_src})
set_property(TARGET ${name}_test PROPERTY FOLDER "tests")
wpilib_target_warnings(${name}_test)
if(BUILD_SHARED_LIBS)
target_compile_definitions(${name}_test PRIVATE -DGTEST_LINKED_AS_SHARED_LIBRARY)
endif()
if(MSVC)
target_compile_options(${name}_test PRIVATE /wd4101 /wd4251)
endif()
add_test(NAME ${name} COMMAND ${name}_test)
endmacro()