diff options
author | David Benjamin <davidben@google.com> | 2024-03-21 15:53:53 +1000 |
---|---|---|
committer | Boringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2024-03-29 17:42:29 +0000 |
commit | dfcaaddcb9229d309fc5eecda5e03e7cca5578e5 (patch) | |
tree | c29c22b369e61ee60d35358846ce1ac10a6bdf49 /CMakeLists.txt | |
parent | 779d01dcdd0e0c933a890d6e7787ba81ae31f625 (diff) | |
download | boringssl-dfcaaddcb9229d309fc5eecda5e03e7cca5578e5.zip boringssl-dfcaaddcb9229d309fc5eecda5e03e7cca5578e5.tar.gz boringssl-dfcaaddcb9229d309fc5eecda5e03e7cca5578e5.tar.bz2 |
Make Go an optional build dependency for the CMake build
Matching the various pre-generated builds, the CMake build no longer
actually requires Go. The only things that need it are:
- Running tests
- Builds with -DFIPS=1
- Builds with the experimental symbol prefixing thing
Bug: 542
Change-Id: I52bb427f54dd6e5719cfe77773e87fc394410380
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/67367
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 869dfac..39352d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,7 @@ foreach(VAR CMAKE_C_FLAGS CMAKE_CXX_FLAGS CMAKE_ASM_FLAGS) endforeach() if(BORINGSSL_PREFIX AND BORINGSSL_PREFIX_SYMBOLS) + require_go() add_definitions(-DBORINGSSL_PREFIX=${BORINGSSL_PREFIX}) # CMake automatically connects include_directories to the NASM command-line, # but not add_definitions. @@ -309,6 +310,7 @@ if(GCOV) endif() if(FIPS) + require_go() add_definitions(-DBORINGSSL_FIPS) if(FIPS_BREAK_TEST) add_definitions("-DBORINGSSL_FIPS_BREAK_${FIPS_BREAK_TEST}=1") @@ -726,22 +728,29 @@ file(STRINGS util/go_tests.txt GO_TESTS) set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS util/go_tests.txt) -add_custom_target( - run_tests - COMMAND ${CMAKE_COMMAND} -E echo "Running Go tests" - COMMAND ${GO_EXECUTABLE} test ${GO_TESTS} - COMMAND ${CMAKE_COMMAND} -E echo - COMMAND ${CMAKE_COMMAND} -E echo "Running unit tests" - COMMAND ${GO_EXECUTABLE} run util/all_tests.go -build-dir - ${CMAKE_CURRENT_BINARY_DIR} - COMMAND ${CMAKE_COMMAND} -E echo - COMMAND ${CMAKE_COMMAND} -E echo "Running SSL tests" - COMMAND cd ssl/test/runner && - ${GO_EXECUTABLE} test -shim-path $<TARGET_FILE:bssl_shim> - ${HANDSHAKER_ARGS} ${RUNNER_ARGS} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS all_tests bssl_shim handshaker fips_specific_tests_if_any - USES_TERMINAL) +if(GO_EXECUTABLE) + add_custom_target( + run_tests + COMMAND ${CMAKE_COMMAND} -E echo "Running Go tests" + COMMAND ${GO_EXECUTABLE} test ${GO_TESTS} + COMMAND ${CMAKE_COMMAND} -E echo + COMMAND ${CMAKE_COMMAND} -E echo "Running unit tests" + COMMAND ${GO_EXECUTABLE} run util/all_tests.go -build-dir + ${CMAKE_CURRENT_BINARY_DIR} + COMMAND ${CMAKE_COMMAND} -E echo + COMMAND ${CMAKE_COMMAND} -E echo "Running SSL tests" + COMMAND cd ssl/test/runner && + ${GO_EXECUTABLE} test -shim-path $<TARGET_FILE:bssl_shim> + ${HANDSHAKER_ARGS} ${RUNNER_ARGS} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS all_tests bssl_shim handshaker fips_specific_tests_if_any + USES_TERMINAL) +else() + add_custom_target( + run_tests + COMMAND ${CMAKE_COMMAND} -E echo "Running tests requires Go" + COMMAND ${CMAKE_COMMAND} -E false) +endif() if(INSTALL_ENABLED) # CMake versions before 3.14 do not have default destination values. Executable |