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 22, 2024
1 parent 04037d0 commit 4d8e8f0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 19 deletions.
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ tristate_option(CCACHE "Use ccache for compiling." "if ccache is found." AUTO)
tristate_option(WITH_NATPMP "Enable NAT-PMP." "if libnatpmp is found." AUTO)
tristate_option(WITH_MINIUPNPC "Enable UPnP." "if libminiupnpc is found." AUTO)
tristate_option(WITH_ZMQ "Enable ZMQ notifications." "if libzmq is found." AUTO)
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()

tristate_option(WITH_EXTERNAL_SIGNER
"Enable external signer support."
"if Boost.Process is found."
Expand Down
11 changes: 0 additions & 11 deletions cmake/optional.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,6 @@ if(WITH_ZMQ)
endif()
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 @@ -293,7 +293,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 @@ -146,8 +146,10 @@ if(NOT WITH_NATPMP AND "@no_natpmp@" STREQUAL "1")
set(WITH_NATPMP OFF CACHE STRING "Enable NAT-PMP.")
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(NOT HARDENING AND "@no_harden@" STREQUAL "1")
Expand Down

0 comments on commit 4d8e8f0

Please sign in to comment.