diff options
author | Pieter Wuille <pieter@wuille.net> | 2023-09-04 12:51:20 -0400 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2023-09-04 12:51:20 -0400 |
commit | 0e0fc18c3cf8c0aa4cca85c4294416463f157870 (patch) | |
tree | 9ea54b2a529bdcf5b380ac54e7894f9aac949eaa /src/secp256k1/examples | |
parent | 6f03c45f6bb5a6edaa3051968b6a1ca4f84d2ccb (diff) | |
parent | c0da4f60e2145a9838c0c5d0a02592faf16d2d8d (diff) | |
download | bitcoin-0e0fc18c3cf8c0aa4cca85c4294416463f157870.tar.xz |
Update secp256k1 subtree to upstream release 0.4.0
Diffstat (limited to 'src/secp256k1/examples')
-rw-r--r-- | src/secp256k1/examples/CMakeLists.txt | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/src/secp256k1/examples/CMakeLists.txt b/src/secp256k1/examples/CMakeLists.txt index e2ea473008..607bb67770 100644 --- a/src/secp256k1/examples/CMakeLists.txt +++ b/src/secp256k1/examples/CMakeLists.txt @@ -1,24 +1,30 @@ -add_library(example INTERFACE) -target_include_directories(example INTERFACE - ${PROJECT_SOURCE_DIR}/include -) -target_link_libraries(example INTERFACE - secp256k1 - $<$<PLATFORM_ID:Windows>:bcrypt> -) +function(add_example name) + set(target_name ${name}_example) + add_executable(${target_name} ${name}.c) + target_include_directories(${target_name} PRIVATE + ${PROJECT_SOURCE_DIR}/include + ) + target_link_libraries(${target_name} + secp256k1 + $<$<PLATFORM_ID:Windows>:bcrypt> + ) + set(test_name ${name}_example) + add_test(NAME ${test_name} COMMAND ${target_name}) + if(BUILD_SHARED_LIBS AND MSVC) + # The DLL must reside either in the same folder where the executable is + # or somewhere in PATH. Using the latter option. + set_tests_properties(${test_name} PROPERTIES + ENVIRONMENT "PATH=$<TARGET_FILE_DIR:secp256k1>;$ENV{PATH}" + ) + endif() +endfunction() -add_executable(ecdsa_example ecdsa.c) -target_link_libraries(ecdsa_example example) -add_test(NAME ecdsa_example COMMAND ecdsa_example) +add_example(ecdsa) if(SECP256K1_ENABLE_MODULE_ECDH) - add_executable(ecdh_example ecdh.c) - target_link_libraries(ecdh_example example) - add_test(NAME ecdh_example COMMAND ecdh_example) + add_example(ecdh) endif() if(SECP256K1_ENABLE_MODULE_SCHNORRSIG) - add_executable(schnorr_example schnorr.c) - target_link_libraries(schnorr_example example) - add_test(NAME schnorr_example COMMAND schnorr_example) + add_example(schnorr) endif() |