Skip to content

Commit

Permalink
cmake [KILL 3-STATE]: Switch WITH_USDT to boolean w/ default OFF
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Apr 30, 2024
1 parent f3c2fea commit ab5992a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ if(WITH_ZMQ)
endif()
endif()

tristate_option(WITH_USDT
"Enable tracepoints for Userspace, Statically Defined Tracing."
"if sys/sdt.h is found."
AUTO
)
option(WITH_USDT "Enable tracepoints for Userspace, Statically Defined Tracing." OFF)
if(WITH_USDT)
find_package(USDT MODULE REQUIRED)
endif()

cmake_dependent_option(WITH_EXTERNAL_SIGNER "Enable external signer support." ON "NOT WIN32" OFF)
set(ENABLE_EXTERNAL_SIGNER ${WITH_EXTERNAL_SIGNER})
tristate_option(WITH_QRENCODE "Enable QR code support." "if libqrencode is found." AUTO)
Expand Down
11 changes: 0 additions & 11 deletions cmake/optional.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,6 @@ if(CCACHE)
mark_as_advanced(CCACHE_COMMAND)
endif()

if(WITH_USDT)
find_package(USDT MODULE)
if(USDT_FOUND)
set(WITH_USDT ON)
elseif(WITH_USDT STREQUAL "AUTO")
set(WITH_USDT OFF)
else()
message(FATAL_ERROR "sys/sdt.h requested, but not found.")
endif()
endif()

if(ENABLE_WALLET)
if(WITH_SQLITE)
if(VCPKG_TARGET_TRIPLET)
Expand Down
2 changes: 1 addition & 1 deletion depends/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ $(host_prefix)/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_$(fina
-e 's|@no_sqlite@|$(NO_SQLITE)|' \
-e 's|@no_upnp@|$(NO_UPNP)|' \
-e 's|@no_natpmp@|$(NO_NATPMP)|' \
-e 's|@no_usdt@|$(NO_USDT)|' \
-e 's|@no_usdt@|$(NO_USDT)|' -e 's|@usdt_packages@|$(usdt_packages_)|' \
-e 's|@no_harden@|$(NO_HARDEN)|' \
-e 's|@multiprocess@|$(MULTIPROCESS)|' \
$< > $@
Expand Down
6 changes: 4 additions & 2 deletions depends/toolchain.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,10 @@ else()
set(WITH_NATPMP ON CACHE BOOL "")
endif()

if(NOT WITH_USDT AND "@no_usdt@" STREQUAL "1")
set(WITH_USDT OFF CACHE STRING "Enable tracepoints for Userspace, Statically Defined Tracing.")
if("@no_usdt@" OR NOT "@usdt_packages@")
set(WITH_USDT OFF CACHE BOOL "")
else()
set(WITH_USDT ON CACHE BOOL "")
endif()

if("@no_harden@")
Expand Down

0 comments on commit ab5992a

Please sign in to comment.