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

build: Disable some targets when external callbacks are enabled #1325

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,12 @@ if(SECP256K1_VALGRIND)
endif()
endif()

option(SECP256K1_BUILD_BENCHMARK "Build benchmarks." ON)
include(CMakeDependentOption)
cmake_dependent_option(SECP256K1_BUILD_BENCHMARK "Build benchmarks." ON "NOT SECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS" OFF)
option(SECP256K1_BUILD_TESTS "Build tests." ON)
option(SECP256K1_BUILD_EXHAUSTIVE_TESTS "Build exhaustive tests." ON)
option(SECP256K1_BUILD_CTIME_TESTS "Build constant-time tests." ${SECP256K1_VALGRIND})
option(SECP256K1_BUILD_EXAMPLES "Build examples." OFF)
cmake_dependent_option(SECP256K1_BUILD_CTIME_TESTS "Build constant-time tests." ${SECP256K1_VALGRIND} "NOT SECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS" OFF)
cmake_dependent_option(SECP256K1_BUILD_EXAMPLES "Build examples." ON "NOT SECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS" OFF)

# Redefine configuration flags.
# We leave assertions on, because they are only used in the examples, and we want them always on there.
Expand Down
6 changes: 6 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ AC_ARG_ENABLE(external_default_callbacks,
AS_HELP_STRING([--enable-external-default-callbacks],[enable external default callback functions [default=no]]), [],
[SECP_SET_DEFAULT([enable_external_default_callbacks], [no], [no])])

if test x"$enable_external_default_callbacks" = x"yes"; then
enable_benchmark="no"
enable_ctime_tests="no"
enable_examples="no"
fi

# Test-only override of the (autodetected by the C code) "widemul" setting.
# Legal values are:
# * int64 (for [u]int64_t),
Expand Down