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

cmake: Move runtime output artifacts to ${PROJECT_BINARY_DIR} #1233

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 4 additions & 5 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ task:
cpu: 4
memory: 3840MB
env:
PATH: '%CIRRUS_WORKING_DIR%\build\src\RelWithDebInfo;%PATH%'
x64_NATIVE_TOOLS: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"'
# Ignore MSBuild warning MSB8029.
# See: https://learn.microsoft.com/en-us/visualstudio/msbuild/errors/msb8029?view=vs-2022
Expand All @@ -403,7 +402,7 @@ task:
- cmake --build build --config RelWithDebInfo -- -property:UseMultiToolTask=true;CL_MPcount=5
check_script:
- '%x64_NATIVE_TOOLS%'
- ctest --test-dir build -j 5
- build\src\RelWithDebInfo\bench_ecmult.exe
- build\src\RelWithDebInfo\bench_internal.exe
- build\src\RelWithDebInfo\bench.exe
- ctest --test-dir build -C RelWithDebInfo -j 5
- build\RelWithDebInfo\bench_ecmult.exe
- build\RelWithDebInfo\bench_internal.exe
- build\RelWithDebInfo\bench.exe
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ if(SECP256K1_BUILD_BENCHMARK OR SECP256K1_BUILD_TESTS OR SECP256K1_BUILD_EXHAUST
enable_testing()
endif()

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
add_subdirectory(src)
if(SECP256K1_BUILD_EXAMPLES)
add_subdirectory(examples)
Expand Down
6 changes: 3 additions & 3 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ endif()

add_executable(ecdsa_example ecdsa.c)
target_link_libraries(ecdsa_example example)
add_test(ecdsa_example ecdsa_example)
add_test(NAME ecdsa_example COMMAND ecdsa_example)

if(SECP256K1_ENABLE_MODULE_ECDH)
add_executable(ecdh_example ecdh.c)
target_link_libraries(ecdh_example example)
add_test(ecdh_example ecdh_example)
add_test(NAME ecdh_example COMMAND ecdh_example)
endif()

if(SECP256K1_ENABLE_MODULE_SCHNORRSIG)
add_executable(schnorr_example schnorr.c)
target_link_libraries(schnorr_example example)
add_test(schnorr_example schnorr_example)
add_test(NAME schnorr_example COMMAND schnorr_example)
endif()
6 changes: 3 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ endif()
if(SECP256K1_BUILD_TESTS)
add_executable(noverify_tests tests.c ${internal_obj})
target_link_libraries(noverify_tests binary_interface)
add_test(noverify_tests noverify_tests)
add_test(NAME noverify_tests COMMAND noverify_tests)
if(NOT CMAKE_BUILD_TYPE STREQUAL "Coverage")
add_executable(tests tests.c ${internal_obj})
target_compile_definitions(tests PRIVATE VERIFY)
target_link_libraries(tests binary_interface)
add_test(tests tests)
add_test(NAME tests COMMAND tests)
endif()
endif()

Expand All @@ -93,7 +93,7 @@ if(SECP256K1_BUILD_EXHAUSTIVE_TESTS)
add_executable(exhaustive_tests tests_exhaustive.c ${common_obj})
target_compile_definitions(exhaustive_tests PRIVATE $<$<NOT:$<CONFIG:Coverage>>:VERIFY>)
target_link_libraries(exhaustive_tests binary_interface)
add_test(exhaustive_tests exhaustive_tests)
add_test(NAME exhaustive_tests COMMAND exhaustive_tests)
endif()

if(SECP256K1_BUILD_CTIME_TESTS)
Expand Down