Skip to content

Commit 6d67278

Browse files
committed
build: Disable benchmarks and examples when ext. callbacks are enabled
1 parent d373a72 commit 6d67278

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,12 @@ if(SECP256K1_VALGRIND)
150150
endif()
151151
endif()
152152

153-
option(SECP256K1_BUILD_BENCHMARK "Build benchmarks." ON)
153+
include(CMakeDependentOption)
154+
cmake_dependent_option(SECP256K1_BUILD_BENCHMARK "Build benchmarks." ON "NOT SECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS" OFF)
154155
option(SECP256K1_BUILD_TESTS "Build tests." ON)
155156
option(SECP256K1_BUILD_EXHAUSTIVE_TESTS "Build exhaustive tests." ON)
156157
option(SECP256K1_BUILD_CTIME_TESTS "Build constant-time tests." ${SECP256K1_VALGRIND})
157-
option(SECP256K1_BUILD_EXAMPLES "Build examples." OFF)
158+
cmake_dependent_option(SECP256K1_BUILD_EXAMPLES "Build examples." ON "NOT SECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS" OFF)
158159

159160
# Redefine configuration flags.
160161
# We leave assertions on, because they are only used in the examples, and we want them always on there.

configure.ac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ AC_ARG_ENABLE(external_default_callbacks,
189189
AS_HELP_STRING([--enable-external-default-callbacks],[enable external default callback functions [default=no]]), [],
190190
[SECP_SET_DEFAULT([enable_external_default_callbacks], [no], [no])])
191191

192+
if test x"$enable_external_default_callbacks" = x"yes"; then
193+
enable_benchmark="no"
194+
enable_examples="no"
195+
fi
196+
192197
# Test-only override of the (autodetected by the C code) "widemul" setting.
193198
# Legal values are:
194199
# * int64 (for [u]int64_t),

0 commit comments

Comments
 (0)