Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Windows/ARM64 assembly build #1697

Merged
merged 4 commits into from
Jul 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Set test location for Visual Studio generator
justsmth committed Jul 12, 2024

Verified

This commit was signed with the committer’s verified signature.
VannTen Max Gautier
commit ab4126256450ae164961936237c0526de5c5d69f
5 changes: 1 addition & 4 deletions .github/workflows/windows-alt.yml
Original file line number Diff line number Diff line change
@@ -108,10 +108,7 @@ jobs:
run: cmake --build ./build --target all_tests
- if: ${{ matrix.target == 'x64' }}
name: Run crypto_test
# MSVC places the tests executables in a different location.
# With MSVC, the "run_tests" target cannot locate the tests.
# We run "crypto_test" as a sanity check.
run: cmake --build ./build --target crypto_test
run: cmake --build ./build --target run_tests
clang-cl-ninja:
if: github.repository_owner == 'aws'
strategy:
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -949,6 +949,20 @@ if(BUILD_TESTING)
endif()

add_subdirectory(util/fipstools/acvp/modulewrapper)

macro(set_test_location executable_name)
if(CMAKE_GENERATOR MATCHES "Visual Studio")
message(NOTICE "Location for ${executable_name} is: ${CMAKE_CURRENT_BINARY_DIR}")
# Set the output directory for the executable
set_target_properties(${executable_name} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_CURRENT_BINARY_DIR}"
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_BINARY_DIR}"
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_CURRENT_BINARY_DIR}"
RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_CURRENT_BINARY_DIR}"
)
endif()
endmacro()
endif()

add_subdirectory(crypto)
5 changes: 5 additions & 0 deletions crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -725,6 +725,7 @@ if(BUILD_TESTING)
add_dependencies(${executable_name} boringssl_prefix_symbols)
target_include_directories(${executable_name} BEFORE PRIVATE ${PROJECT_BINARY_DIR}/symbol_prefix_include)
add_dependencies(all_tests ${executable_name})
set_test_location(${executable_name})
endmacro()

# Below tests are added as new executables to be executed in single process.
@@ -740,6 +741,7 @@ if(BUILD_TESTING)
${RANDOM_TEST_EXEC}
fipsmodule/rand/urandom_test.cc
)
set_test_location(${RANDOM_TEST_EXEC})

add_dependencies(${RANDOM_TEST_EXEC} boringssl_prefix_symbols)
target_link_libraries(${RANDOM_TEST_EXEC} test_support_lib boringssl_gtest crypto)
@@ -835,6 +837,7 @@ if(BUILD_TESTING)

$<TARGET_OBJECTS:crypto_test_data>
)
set_test_location(${CRYPTO_TEST_EXEC})

add_dependencies(${CRYPTO_TEST_EXEC} boringssl_prefix_symbols)
target_link_libraries(${CRYPTO_TEST_EXEC} boringssl_gtest_main)
@@ -850,6 +853,7 @@ if(BUILD_TESTING)

add_executable(${DYNAMIC_LOADING_TEST_EXEC} dynamic_loading_test.c)
add_dependencies(${DYNAMIC_LOADING_TEST_EXEC} crypto)
set_test_location(${DYNAMIC_LOADING_TEST_EXEC})

add_dependencies(${DYNAMIC_LOADING_TEST_EXEC} boringssl_prefix_symbols)
target_include_directories(${DYNAMIC_LOADING_TEST_EXEC} BEFORE PRIVATE ${PROJECT_BINARY_DIR}/symbol_prefix_include)
@@ -874,6 +878,7 @@ if(BUILD_TESTING)
message(STATUS "Generating test executable ${RWLOCK_STATIC_INIT_TEST_EXEC}.")
add_executable(${RWLOCK_STATIC_INIT_TEST_EXEC} rwlock_static_init.cc)
add_dependencies(${RWLOCK_STATIC_INIT_TEST_EXEC} crypto)
set_test_location(${RWLOCK_STATIC_INIT_TEST_EXEC})

target_link_libraries(${RWLOCK_STATIC_INIT_TEST_EXEC} crypto)
target_include_directories(${RWLOCK_STATIC_INIT_TEST_EXEC} BEFORE PRIVATE ${PROJECT_BINARY_DIR}/symbol_prefix_include)
2 changes: 2 additions & 0 deletions ssl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -73,6 +73,7 @@ if(BUILD_TESTING)
boringssl_gtest_main ssl )
target_include_directories(${INTEGRATION_TEST_EXEC} BEFORE PRIVATE ${PROJECT_BINARY_DIR}/symbol_prefix_include)
add_dependencies(all_tests ${INTEGRATION_TEST_EXEC})
set_test_location(${INTEGRATION_TEST_EXEC})

add_executable(
${SSL_TEST_EXEC}
@@ -83,6 +84,7 @@ if(BUILD_TESTING)
)

target_link_libraries(${SSL_TEST_EXEC} boringssl_gtest_main ssl)
set_test_location(${SSL_TEST_EXEC})

target_include_directories(${SSL_TEST_EXEC} BEFORE PRIVATE ${PROJECT_BINARY_DIR}/symbol_prefix_include)

1 change: 1 addition & 0 deletions tool-openssl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -52,4 +52,5 @@ if(BUILD_TESTING)
target_link_libraries(tool_openssl_test boringssl_gtest_main ssl crypto)
target_include_directories(tool_openssl_test BEFORE PRIVATE ${PROJECT_BINARY_DIR}/symbol_prefix_include)
add_dependencies(all_tests tool_openssl_test)
set_test_location(tool_openssl_test)
endif()
2 changes: 1 addition & 1 deletion util/build_compilation_database.sh
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ MY_CMAKE_FLAGS=("-GNinja" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_EXPORT_COMPILE_COM

mkdir -p "${AWS_LC_BUILD}"

cmake "${BASE_DIR}" -B "${AWS_LC_BUILD}" ${MY_CMAKE_FLAGS[@]} "${@}"
cmake "${BASE_DIR}" -B "${AWS_LC_BUILD}" "${MY_CMAKE_FLAGS[@]}" "${@}"

cmake --build "${AWS_LC_BUILD}" -j 4 --target all_tests