blob: 4896c4a222e250198c389a6766f8f1a0ad9d23cc [file] [log] [blame]
Brian Silverman8fce7482020-01-05 13:18:21 -08001include(CompileWarnings)
2
3macro(wpilib_add_test name srcdir)
4 file(GLOB_RECURSE test_src ${srcdir}/*.cpp)
5 add_executable(${name}_test ${test_src})
6 wpilib_target_warnings(${name}_test)
Maxwell Henderson80bec322024-01-09 15:48:44 -08007 if(BUILD_SHARED_LIBS)
Brian Silverman8fce7482020-01-05 13:18:21 -08008 target_compile_definitions(${name}_test PRIVATE -DGTEST_LINKED_AS_SHARED_LIBRARY)
9 endif()
Maxwell Henderson80bec322024-01-09 15:48:44 -080010 if(MSVC)
Austin Schuh812d0d12021-11-04 20:16:48 -070011 target_compile_options(${name}_test PRIVATE /wd4101 /wd4251)
Brian Silverman8fce7482020-01-05 13:18:21 -080012 endif()
13 add_test(NAME ${name} COMMAND ${name}_test)
14endmacro()