Skip to content

Commit

Permalink
cmake: Revert CMake's way to handle USE_QRCODE definition
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Jul 18, 2024
1 parent c0ff924 commit 2408fee
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ cmake_dependent_option(WITH_QRENCODE "Enable QR code support." ON "BUILD_GUI" OF
if(WITH_QRENCODE)
find_package(PkgConfig REQUIRED)
pkg_check_modules(libqrencode REQUIRED IMPORTED_TARGET libqrencode)
target_compile_definitions(PkgConfig::libqrencode INTERFACE
USE_QRCODE
)
set(USE_QRCODE TRUE)
endif()

cmake_dependent_option(WITH_DBUS "Enable DBus support." ON "CMAKE_SYSTEM_NAME STREQUAL \"Linux\" AND BUILD_GUI" OFF)
Expand Down
3 changes: 3 additions & 0 deletions cmake/bitcoin-config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@
/* Define to 1 to enable wallet functions. */
#cmakedefine ENABLE_WALLET 1

/* Define if QR support should be compiled in */
#cmakedefine USE_QRCODE 1

/* Define if SQLite support should be compiled in. */
#cmakedefine USE_SQLITE

Expand Down
2 changes: 2 additions & 0 deletions src/qt/qrimagewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include <QMouseEvent>
#include <QPainter>

#include <config/bitcoin-config.h> // IWYU pragma: keep

#ifdef USE_QRCODE
#include <qrencode.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/qt/receiverequestdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <QDialog>
#include <QString>

#include <config/bitcoin-config.h> // IWYU pragma: keep

ReceiveRequestDialog::ReceiveRequestDialog(QWidget* parent)
: QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::ReceiveRequestDialog)
Expand Down

0 comments on commit 2408fee

Please sign in to comment.