blob: eef41131e22841301ff00378568019b35941ebb2 [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)
7 if (BUILD_SHARED_LIBS)
8 target_compile_definitions(${name}_test PRIVATE -DGTEST_LINKED_AS_SHARED_LIBRARY)
9 endif()
10 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()