diff --git a/tool-openssl/CMakeLists.txt b/tool-openssl/CMakeLists.txt index 59b6ce5e01..aacaaf2834 100644 --- a/tool-openssl/CMakeLists.txt +++ b/tool-openssl/CMakeLists.txt @@ -39,18 +39,16 @@ if(MSVC AND CMAKE_BUILD_TYPE_LOWER MATCHES "relwithdebinfo" AND FIPS) install (FILES $/openssl.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() - -add_executable( - x509_test - - x509_test.cc - ../tool/args.cc - ../tool/file.cc - x509.cc -) - -target_link_libraries(x509_test boringssl_gtest_main ssl crypto) -enable_testing() -add_test(NAME X509Test COMMAND x509_test) - - +if(BUILD_TESTING) + add_executable( + x509_test + + x509_test.cc + ../tool/args.cc + ../tool/file.cc + x509.cc + ) + + target_link_libraries(x509_test boringssl_gtest_main ssl crypto) + add_dependencies(all_tests x509_test) +endif() diff --git a/util/all_tests.json b/util/all_tests.json index 464414ad8d..7fa3c333dd 100644 --- a/util/all_tests.json +++ b/util/all_tests.json @@ -125,5 +125,10 @@ "cmd": [ "crypto/rwlock_static_init" ] + }, + { + "cmd": [ + "tool-openssl/x509_test" + ] } ]