Skip to content

Commit

Permalink
Plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
tobtoht committed Dec 4, 2023
1 parent 1471234 commit db0c8d6
Show file tree
Hide file tree
Showing 96 changed files with 3,060 additions and 725 deletions.
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ set(COPYRIGHT_HOLDERS "The Monero Project")
# Configurable options
option(STATIC "Link libraries statically, requires static Qt" OFF)
option(SELF_CONTAINED "Disable when building Feather for packages" OFF)
option(LOCALMONERO "Include LocalMonero module" ON)
option(XMRIG "Include XMRig module" ON)
option(TOR_DIR "Directory containing Tor binaries to embed inside Feather" OFF)
option(CHECK_UPDATES "Enable checking for application updates" OFF)
option(PLATFORM_INSTALLER "Built-in updater fetches installer (windows-only)" OFF)
Expand All @@ -28,6 +26,18 @@ option(DONATE_BEG "Prompt donation window every once in a while" OFF)
option(WITH_SCANNER "Enable webcam QR scanner" ON)
option(STACK_TRACE "Dump stack trace on crash (Linux only)" OFF)

# Plugins
option(WITH_PLUGIN_HOME "Include Home tab plugin" ON)
option(WITH_PLUGIN_TICKERS "Include Tickers Home plugin" ON)
option(WITH_PLUGIN_CROWDFUNDING "Include Crowdfunding Home plugin" ON)
option(WITH_PLUGIN_BOUNTIES "Include Bounties Home plugin" ON)
option(WITH_PLUGIN_REDDIT "Include Reddit Home plugin" ON)
option(WITH_PLUGIN_REVUO "Include Revuo Home plugin" ON)
option(WITH_PLUGIN_CALC "Include Calc tab plugin" ON)
option(WITH_PLUGIN_EXCHANGE "Include Exchange tab plugin" ON)
option(WITH_PLUGIN_LOCALMONERO "Include LocalMonero plugin" ON)
option(WITH_PLUGIN_XMRIG "Include XMRig plugin" ON)

list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake")
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
Expand Down
3 changes: 1 addition & 2 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,9 @@ On platforms without `execinfo.h` use `cmake -DSTACK_TRACE:BOOL=OFF ..` instead

There are some CMake options that you may pass to control how Feather is built:

- `-DLOCALMONERO=OFF` - disable LocalMonero feature
- `-DXMRIG=OFF` - disable XMRig feature
- `-DCHECK_UPDATES=ON` - enable checking for updates, only for standalone binaries
- `-DDONATE_BEG=OFF` - disable the dreaded donate requests
- `-DUSE_DEVICE_TREZOR=OFF` - disable Trezor hardware wallet support
- `-DWITH_SCANNER=ON` - enable the webcam QR code scanner
- `-DTOR_DIR=/path/to/tor/` - embed a Tor binary in Feather, argument should be a directory containing the binary
- `-DWITH_PLUGIN_<NAME>=OFF` - disable a plugin
36 changes: 26 additions & 10 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,34 @@ file(GLOB SOURCE_FILES
"monero_seed/*.cpp"
"monero_seed/*.c"
"monero_seed/*.hpp"
"plugins/*/*.cpp"
"plugins/*/*.h"
"plugins/*.cpp"
"plugins/*.h"
)

get_cmake_property(_vars VARIABLES)
set(PLUGIN_PREFIX "WITH_PLUGIN_")

foreach (_var ${_vars})
string(REGEX MATCH "^${PLUGIN_PREFIX}" _isPlugin ${_var})

if (NOT _var)
continue()
endif()

if(_isPlugin)
string(REPLACE "${PLUGIN_PREFIX}" "" _suffix ${_var})
string(TOLOWER "${_suffix}" _plugin)
message(STATUS "Adding plugin: ${_plugin}")
file (GLOB PLUGIN_FILES
"plugins/${_plugin}/*.cpp"
"plugins/${_plugin}/*.h"
)
list (APPEND SOURCE_FILES
${PLUGIN_FILES}
)
endif()
endforeach()

if (CHECK_UPDATES)
file(GLOB UPDATER_FILES
"utils/updater/*.h"
Expand Down Expand Up @@ -177,18 +201,10 @@ if (CHECK_UPDATES)
target_compile_definitions(feather PRIVATE CHECK_UPDATES=1)
endif()

if(LOCALMONERO)
target_compile_definitions(feather PRIVATE HAS_LOCALMONERO=1)
endif()

if(TOR_DIR)
target_compile_definitions(feather PRIVATE HAS_TOR_BIN=1)
endif()

if(XMRIG)
target_compile_definitions(feather PRIVATE HAS_XMRIG=1)
endif()

if(WITH_SCANNER)
target_compile_definitions(feather PRIVATE WITH_SCANNER=1)
endif()
Expand Down
Loading

0 comments on commit db0c8d6

Please sign in to comment.