Skip to content

Commit db0c8d6

Browse files
committed
Plugins
1 parent 1471234 commit db0c8d6

File tree

96 files changed

+3060
-725
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+3060
-725
lines changed

CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ set(COPYRIGHT_HOLDERS "The Monero Project")
1818
# Configurable options
1919
option(STATIC "Link libraries statically, requires static Qt" OFF)
2020
option(SELF_CONTAINED "Disable when building Feather for packages" OFF)
21-
option(LOCALMONERO "Include LocalMonero module" ON)
22-
option(XMRIG "Include XMRig module" ON)
2321
option(TOR_DIR "Directory containing Tor binaries to embed inside Feather" OFF)
2422
option(CHECK_UPDATES "Enable checking for application updates" OFF)
2523
option(PLATFORM_INSTALLER "Built-in updater fetches installer (windows-only)" OFF)
@@ -28,6 +26,18 @@ option(DONATE_BEG "Prompt donation window every once in a while" OFF)
2826
option(WITH_SCANNER "Enable webcam QR scanner" ON)
2927
option(STACK_TRACE "Dump stack trace on crash (Linux only)" OFF)
3028

29+
# Plugins
30+
option(WITH_PLUGIN_HOME "Include Home tab plugin" ON)
31+
option(WITH_PLUGIN_TICKERS "Include Tickers Home plugin" ON)
32+
option(WITH_PLUGIN_CROWDFUNDING "Include Crowdfunding Home plugin" ON)
33+
option(WITH_PLUGIN_BOUNTIES "Include Bounties Home plugin" ON)
34+
option(WITH_PLUGIN_REDDIT "Include Reddit Home plugin" ON)
35+
option(WITH_PLUGIN_REVUO "Include Revuo Home plugin" ON)
36+
option(WITH_PLUGIN_CALC "Include Calc tab plugin" ON)
37+
option(WITH_PLUGIN_EXCHANGE "Include Exchange tab plugin" ON)
38+
option(WITH_PLUGIN_LOCALMONERO "Include LocalMonero plugin" ON)
39+
option(WITH_PLUGIN_XMRIG "Include XMRig plugin" ON)
40+
3141
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake")
3242
include(CheckCCompilerFlag)
3343
include(CheckCXXCompilerFlag)

HACKING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,9 @@ On platforms without `execinfo.h` use `cmake -DSTACK_TRACE:BOOL=OFF ..` instead
123123

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

126-
- `-DLOCALMONERO=OFF` - disable LocalMonero feature
127-
- `-DXMRIG=OFF` - disable XMRig feature
128126
- `-DCHECK_UPDATES=ON` - enable checking for updates, only for standalone binaries
129127
- `-DDONATE_BEG=OFF` - disable the dreaded donate requests
130128
- `-DUSE_DEVICE_TREZOR=OFF` - disable Trezor hardware wallet support
131129
- `-DWITH_SCANNER=ON` - enable the webcam QR code scanner
132130
- `-DTOR_DIR=/path/to/tor/` - embed a Tor binary in Feather, argument should be a directory containing the binary
131+
- `-DWITH_PLUGIN_<NAME>=OFF` - disable a plugin

src/CMakeLists.txt

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,34 @@ file(GLOB SOURCE_FILES
6969
"monero_seed/*.cpp"
7070
"monero_seed/*.c"
7171
"monero_seed/*.hpp"
72-
"plugins/*/*.cpp"
73-
"plugins/*/*.h"
72+
"plugins/*.cpp"
73+
"plugins/*.h"
7474
)
7575

76+
get_cmake_property(_vars VARIABLES)
77+
set(PLUGIN_PREFIX "WITH_PLUGIN_")
78+
79+
foreach (_var ${_vars})
80+
string(REGEX MATCH "^${PLUGIN_PREFIX}" _isPlugin ${_var})
81+
82+
if (NOT _var)
83+
continue()
84+
endif()
85+
86+
if(_isPlugin)
87+
string(REPLACE "${PLUGIN_PREFIX}" "" _suffix ${_var})
88+
string(TOLOWER "${_suffix}" _plugin)
89+
message(STATUS "Adding plugin: ${_plugin}")
90+
file (GLOB PLUGIN_FILES
91+
"plugins/${_plugin}/*.cpp"
92+
"plugins/${_plugin}/*.h"
93+
)
94+
list (APPEND SOURCE_FILES
95+
${PLUGIN_FILES}
96+
)
97+
endif()
98+
endforeach()
99+
76100
if (CHECK_UPDATES)
77101
file(GLOB UPDATER_FILES
78102
"utils/updater/*.h"
@@ -177,18 +201,10 @@ if (CHECK_UPDATES)
177201
target_compile_definitions(feather PRIVATE CHECK_UPDATES=1)
178202
endif()
179203

180-
if(LOCALMONERO)
181-
target_compile_definitions(feather PRIVATE HAS_LOCALMONERO=1)
182-
endif()
183-
184204
if(TOR_DIR)
185205
target_compile_definitions(feather PRIVATE HAS_TOR_BIN=1)
186206
endif()
187207

188-
if(XMRIG)
189-
target_compile_definitions(feather PRIVATE HAS_XMRIG=1)
190-
endif()
191-
192208
if(WITH_SCANNER)
193209
target_compile_definitions(feather PRIVATE WITH_SCANNER=1)
194210
endif()

0 commit comments

Comments
 (0)