Skip to content

Commit

Permalink
cmake: Add WITH_DBUS option
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Apr 28, 2024
1 parent 9a99b72 commit 5a85ac0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ tristate_option(WITH_USDT
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)
cmake_dependent_option(WITH_DBUS "Enable DBus support." ON "CMAKE_SYSTEM_NAME STREQUAL \"Linux\" AND BUILD_GUI" OFF)

option(MULTIPROCESS "Build multiprocess bitcoin-node, bitcoin-wallet, and bitcoin-gui executables in addition to monolithic bitcoind and bitcoin-qt executables. Requires libmultiprocess library. Experimental." OFF)
if(MULTIPROCESS)
Expand Down Expand Up @@ -566,6 +567,7 @@ message(" UPnP ................................ ${WITH_MINIUPNPC}")
message(" ZeroMQ .............................. ${WITH_ZMQ}")
message(" USDT tracing ........................ ${WITH_USDT}")
message(" QR code (GUI) ....................... ${WITH_QRENCODE}")
message(" DBus (GUI, Linux only) .............. ${WITH_DBUS}")
message("Tests:")
message(" test_bitcoin ........................ ${BUILD_TESTS}")
message(" test_bitcoin-qt ..................... ${BUILD_GUI_TESTS}")
Expand Down
8 changes: 8 additions & 0 deletions src/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ set(qt_components Core Gui Widgets LinguistTools)
if(ENABLE_WALLET)
list(APPEND qt_components Network)
endif()
if(WITH_DBUS)
list(APPEND qt_components DBus)
endif()
if(BUILD_GUI_TESTS)
list(APPEND qt_components Test)
endif()
Expand Down Expand Up @@ -174,6 +177,11 @@ if(ENABLE_WALLET)
)
endif()

if(WITH_DBUS)
target_compile_definitions(bitcoinqt PRIVATE USE_DBUS)
target_link_libraries(bitcoinqt PRIVATE Qt5::DBus)
endif()

if(QT_IS_STATIC)
# We want to define static plugins to link ourselves, thus preventing
# automatic linking against a "sane" set of default static plugins.
Expand Down

0 comments on commit 5a85ac0

Please sign in to comment.