diff --git a/test/unit_tests/sundials/CMakeLists.txt b/test/unit_tests/sundials/CMakeLists.txt index e5fc937f5b..1fd2924cce 100644 --- a/test/unit_tests/sundials/CMakeLists.txt +++ b/test/unit_tests/sundials/CMakeLists.txt @@ -10,8 +10,11 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -add_executable(test_sundials_errors test_sundials_errors.cpp) -target_link_libraries(test_sundials_errors PRIVATE sundials_core sundials_nvecserial GTest::gtest_main GTest::gmock) -gtest_discover_tests(test_sundials_errors) +if(SUNDIALS_ENABLE_ERROR_CHECKS) + add_executable(test_sundials_errors test_sundials_errors.cpp) + target_link_libraries(test_sundials_errors + PRIVATE sundials_core sundials_nvecserial GTest::gtest_main GTest::gmock) + gtest_discover_tests(test_sundials_errors) +endif() add_subdirectory(reductions)