diff options
author | David Benjamin <davidben@google.com> | 2023-06-30 15:05:24 -0400 |
---|---|---|
committer | Boringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-07-05 20:59:04 +0000 |
commit | 847a395a50914fd5dc1261884aa58eb428838a4c (patch) | |
tree | 6394fd03238c4098e9255158cc462c4cd25f4bc2 /CMakeLists.txt | |
parent | 197b57154f3cc3c0c32b251c3c233caa0c0a0d94 (diff) | |
download | boringssl-847a395a50914fd5dc1261884aa58eb428838a4c.zip boringssl-847a395a50914fd5dc1261884aa58eb428838a4c.tar.gz boringssl-847a395a50914fd5dc1261884aa58eb428838a4c.tar.bz2 |
Use sources.cmake for the test_support library
As part of this, align the generated and standalone builds in how
crypto/test/gtest_main.cc is added. Since not all test targets
(urandom_test) include gtest_main.cc, and the generated one just
manually adds it to the file lists, just put it into the file lists
ahead of time. That way we don't need to synchronize the dependency
information with the generated build.
This also aligns the generated build with
https://boringssl-review.googlesource.com/c/boringssl/+/56567 to put
files like crypto/test/abi_test.cc and crypto/test/file_test_gtest.cc in
the test_support library.
Update-Note: If something odd happens with the test_support library in
downstream builds, this CL is probably to blame.
Bug: 542
Change-Id: I235e0ccd0432f4b380a92b265ede35eb8a6a6e36
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/61288
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Bob Beck <bbe@google.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index efb5cda..4f3eb37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -520,6 +520,17 @@ add_subdirectory(util/fipstools) add_subdirectory(util/fipstools/acvp/modulewrapper) add_subdirectory(decrepit) +add_library(test_support_lib STATIC ${TEST_SUPPORT_SOURCES}) +if (LIBUNWIND_FOUND) + target_compile_options(test_support_lib PRIVATE ${LIBUNWIND_CFLAGS_OTHER}) + target_include_directories(test_support_lib PRIVATE ${LIBUNWIND_INCLUDE_DIRS}) + target_link_libraries(test_support_lib ${LIBUNWIND_LDFLAGS}) +endif() +if(WIN32) + target_link_libraries(test_support_lib dbghelp) +endif() +target_link_libraries(test_support_lib boringssl_gtest crypto) + # urandom_test is a separate binary because it needs to be able to observe the # PRNG initialisation, which means that it can't have other tests running before # it does. @@ -528,15 +539,15 @@ target_link_libraries(urandom_test test_support_lib boringssl_gtest crypto) add_dependencies(all_tests urandom_test) add_executable(crypto_test ${CRYPTO_TEST_SOURCES} $<TARGET_OBJECTS:crypto_test_data>) -target_link_libraries(crypto_test test_support_lib boringssl_gtest_main crypto) +target_link_libraries(crypto_test test_support_lib boringssl_gtest crypto) add_dependencies(all_tests crypto_test) add_executable(ssl_test ${SSL_TEST_SOURCES}) -target_link_libraries(ssl_test test_support_lib boringssl_gtest_main ssl crypto) +target_link_libraries(ssl_test test_support_lib boringssl_gtest ssl crypto) add_dependencies(all_tests ssl_test) add_executable(decrepit_test ${DECREPIT_TEST_SOURCES}) -target_link_libraries(decrepit_test test_support_lib boringssl_gtest_main +target_link_libraries(decrepit_test test_support_lib boringssl_gtest decrepit crypto) add_dependencies(all_tests decrepit_test) @@ -550,7 +561,7 @@ target_link_libraries(pki crypto) add_executable(pki_test ${PKI_TEST_SOURCES}) target_compile_definitions(pki_test PRIVATE _BORINGSSL_LIBPKI_) -target_link_libraries(pki_test test_support_lib boringssl_gtest_main pki crypto) +target_link_libraries(pki_test test_support_lib boringssl_gtest pki crypto) add_dependencies(all_tests pki_test) # The PKI library requires C++17. |