James Kuszmaul | 4f3ad3c | 2019-12-01 16:35:21 -0800 | [diff] [blame^] | 1 | include(CompileWarnings) |
| 2 | |
| 3 | macro(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) |
| 11 | target_compile_options(${name}_test PRIVATE /wd4251 /wd4101) |
| 12 | endif() |
| 13 | add_test(NAME ${name} COMMAND ${name}_test) |
| 14 | endmacro() |