| 1 | # The Flutter tooling requires that developers have CMake 3.10 or later |
| 2 | # installed. You should not increase this version, as doing so will cause |
| 3 | # the plugin to fail to compile for some customers of the plugin. |
| 4 | cmake_minimum_required(VERSION 3.10) |
| 5 | |
| 6 | # Project-level configuration. |
| 7 | set(PROJECT_NAME "cw_monero") |
| 8 | project(${PROJECT_NAME} LANGUAGES CXX) |
| 9 | |
| 10 | # This value is used when generating builds using this plugin, so it must |
| 11 | # not be changed. |
| 12 | set(PLUGIN_NAME "cw_monero_plugin") |
| 13 | |
| 14 | # Define the plugin library target. Its name must not be changed (see comment |
| 15 | # on PLUGIN_NAME above). |
| 16 | # |
| 17 | # Any new source files that you add to the plugin should be added here. |
| 18 | add_library(${PLUGIN_NAME} SHARED |
| 19 | "cw_monero_plugin.cc" |
| 20 | "../ios/Classes/monero_api.cpp" |
| 21 | ) |
| 22 | |
| 23 | # Apply a standard set of build settings that are configured in the |
| 24 | # application-level CMakeLists.txt. This can be removed for plugins that want |
| 25 | # full control over build settings. |
| 26 | apply_standard_settings(${PLUGIN_NAME}) |
| 27 | |
| 28 | # Symbols are hidden by default to reduce the chance of accidental conflicts |
| 29 | # between plugins. This should not be removed; any symbols that should be |
| 30 | # exported should be explicitly exported with the FLUTTER_PLUGIN_EXPORT macro. |
| 31 | set_target_properties(${PLUGIN_NAME} PROPERTIES |
| 32 | CXX_VISIBILITY_PRESET hidden) |
| 33 | target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) |
| 34 | |
| 35 | # Source include directories and library dependencies. Add any plugin-specific |
| 36 | # dependencies here. |
| 37 | target_include_directories(${PLUGIN_NAME} INTERFACE |
| 38 | "${CMAKE_CURRENT_SOURCE_DIR}/include") |
| 39 | target_link_libraries(${PLUGIN_NAME} PRIVATE flutter) |
| 40 | target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK) |
| 41 | target_link_libraries(${PLUGIN_NAME} PUBLIC cw_monero) |
| 42 | # List of absolute paths to libraries that should be bundled with the plugin. |
| 43 | # This list could contain prebuilt libraries, or libraries created by an |
| 44 | # external build triggered from this build file. |
| 45 | set(cw_monero_bundled_libraries |
| 46 | "" |
| 47 | PARENT_SCOPE |
| 48 | ) |
| 49 | |
| 50 | add_library( cw_monero |
| 51 | STATIC |
| 52 | ../ios/Classes/monero_api.cpp) |
| 53 | |
| 54 | set(EXTERNAL_LIBS_DIR ${CMAKE_SOURCE_DIR}/../cw_shared_external/ios/External/linux) |
| 55 | |
| 56 | ############ |
| 57 | # libsodium |
| 58 | ############ |
| 59 | |
| 60 | add_library(sodium STATIC IMPORTED) |
| 61 | set_target_properties(sodium PROPERTIES IMPORTED_LOCATION |
| 62 | ${EXTERNAL_LIBS_DIR}/lib/libsodium.a) |
| 63 | |
| 64 | ############ |
| 65 | # OpenSSL |
| 66 | ############ |
| 67 | |
| 68 | add_library(crypto STATIC IMPORTED) |
| 69 | set_target_properties(crypto PROPERTIES IMPORTED_LOCATION |
| 70 | ${EXTERNAL_LIBS_DIR}/lib/libcrypto.a) |
| 71 | |
| 72 | add_library(ssl STATIC IMPORTED) |
| 73 | set_target_properties(ssl PROPERTIES IMPORTED_LOCATION |
| 74 | ${EXTERNAL_LIBS_DIR}/lib/libssl.a) |
| 75 | |
| 76 | ############ |
| 77 | # Boost |
| 78 | ############ |
| 79 | |
| 80 | add_library(boost_chrono STATIC IMPORTED) |
| 81 | set_target_properties(boost_chrono PROPERTIES IMPORTED_LOCATION |
| 82 | ${EXTERNAL_LIBS_DIR}/lib/libboost_chrono.a) |
| 83 | |
| 84 | add_library(boost_date_time STATIC IMPORTED) |
| 85 | set_target_properties(boost_date_time PROPERTIES IMPORTED_LOCATION |
| 86 | ${EXTERNAL_LIBS_DIR}/lib/libboost_date_time.a) |
| 87 | |
| 88 | add_library(boost_filesystem STATIC IMPORTED) |
| 89 | set_target_properties(boost_filesystem PROPERTIES IMPORTED_LOCATION |
| 90 | ${EXTERNAL_LIBS_DIR}/lib/libboost_filesystem.a) |
| 91 | |
| 92 | add_library(boost_program_options STATIC IMPORTED) |
| 93 | set_target_properties(boost_program_options PROPERTIES IMPORTED_LOCATION |
| 94 | ${EXTERNAL_LIBS_DIR}/lib/libboost_program_options.a) |
| 95 | |
| 96 | add_library(boost_regex STATIC IMPORTED) |
| 97 | set_target_properties(boost_regex PROPERTIES IMPORTED_LOCATION |
| 98 | ${EXTERNAL_LIBS_DIR}/lib/libboost_regex.a) |
| 99 | |
| 100 | add_library(boost_serialization STATIC IMPORTED) |
| 101 | set_target_properties(boost_serialization PROPERTIES IMPORTED_LOCATION |
| 102 | ${EXTERNAL_LIBS_DIR}/lib/libboost_serialization.a) |
| 103 | |
| 104 | add_library(boost_system STATIC IMPORTED) |
| 105 | set_target_properties(boost_system PROPERTIES IMPORTED_LOCATION |
| 106 | ${EXTERNAL_LIBS_DIR}/lib/libboost_system.a) |
| 107 | |
| 108 | add_library(boost_thread STATIC IMPORTED) |
| 109 | set_target_properties(boost_thread PROPERTIES IMPORTED_LOCATION |
| 110 | ${EXTERNAL_LIBS_DIR}/lib/libboost_thread.a) |
| 111 | |
| 112 | add_library(boost_wserialization STATIC IMPORTED) |
| 113 | set_target_properties(boost_wserialization PROPERTIES IMPORTED_LOCATION |
| 114 | ${EXTERNAL_LIBS_DIR}/lib/libboost_wserialization.a) |
| 115 | |
| 116 | ############# |
| 117 | # Monero |
| 118 | ############# |
| 119 | |
| 120 | |
| 121 | add_library(wallet STATIC IMPORTED) |
| 122 | set_target_properties(wallet PROPERTIES IMPORTED_LOCATION |
| 123 | ${EXTERNAL_LIBS_DIR}/lib/monero/libwallet.a) |
| 124 | |
| 125 | add_library(wallet_api STATIC IMPORTED) |
| 126 | set_target_properties(wallet_api PROPERTIES IMPORTED_LOCATION |
| 127 | ${EXTERNAL_LIBS_DIR}/lib/monero/libwallet_api.a) |
| 128 | |
| 129 | add_library(cryptonote_core STATIC IMPORTED) |
| 130 | set_target_properties(cryptonote_core PROPERTIES IMPORTED_LOCATION |
| 131 | ${EXTERNAL_LIBS_DIR}/lib/monero/libcryptonote_core.a) |
| 132 | |
| 133 | add_library(cryptonote_basic STATIC IMPORTED) |
| 134 | set_target_properties(cryptonote_basic PROPERTIES IMPORTED_LOCATION |
| 135 | ${EXTERNAL_LIBS_DIR}/lib/monero/libcryptonote_basic.a) |
| 136 | |
| 137 | add_library(cryptonote_format_utils_basic STATIC IMPORTED) |
| 138 | set_target_properties(cryptonote_format_utils_basic PROPERTIES IMPORTED_LOCATION |
| 139 | ${EXTERNAL_LIBS_DIR}/lib/monero/libcryptonote_format_utils_basic.a) |
| 140 | |
| 141 | add_library(mnemonics STATIC IMPORTED) |
| 142 | set_target_properties(mnemonics PROPERTIES IMPORTED_LOCATION |
| 143 | ${EXTERNAL_LIBS_DIR}/lib/monero/libmnemonics.a) |
| 144 | |
| 145 | add_library(common STATIC IMPORTED) |
| 146 | set_target_properties(common PROPERTIES IMPORTED_LOCATION |
| 147 | ${EXTERNAL_LIBS_DIR}/lib/monero/libcommon.a) |
| 148 | |
| 149 | add_library(cncrypto STATIC IMPORTED) |
| 150 | set_target_properties(cncrypto PROPERTIES IMPORTED_LOCATION |
| 151 | ${EXTERNAL_LIBS_DIR}/lib/monero/libcncrypto.a) |
| 152 | |
| 153 | add_library(ringct STATIC IMPORTED) |
| 154 | set_target_properties(ringct PROPERTIES IMPORTED_LOCATION |
| 155 | ${EXTERNAL_LIBS_DIR}/lib/monero/libringct.a) |
| 156 | |
| 157 | add_library(ringct_basic STATIC IMPORTED) |
| 158 | set_target_properties(ringct_basic PROPERTIES IMPORTED_LOCATION |
| 159 | ${EXTERNAL_LIBS_DIR}/lib/monero/libringct_basic.a) |
| 160 | |
| 161 | add_library(blockchain_db STATIC IMPORTED) |
| 162 | set_target_properties(blockchain_db PROPERTIES IMPORTED_LOCATION |
| 163 | ${EXTERNAL_LIBS_DIR}/lib/monero/libblockchain_db.a) |
| 164 | |
| 165 | add_library(lmdb STATIC IMPORTED) |
| 166 | set_target_properties(lmdb PROPERTIES IMPORTED_LOCATION |
| 167 | ${EXTERNAL_LIBS_DIR}/lib/monero/liblmdb.a) |
| 168 | |
| 169 | add_library(easylogging STATIC IMPORTED) |
| 170 | set_target_properties(easylogging PROPERTIES IMPORTED_LOCATION |
| 171 | ${EXTERNAL_LIBS_DIR}/lib/monero/libeasylogging.a) |
| 172 | |
| 173 | add_library(epee STATIC IMPORTED) |
| 174 | set_target_properties(epee PROPERTIES IMPORTED_LOCATION |
| 175 | ${EXTERNAL_LIBS_DIR}/lib/monero/libepee.a) |
| 176 | |
| 177 | add_library(blocks STATIC IMPORTED) |
| 178 | set_target_properties(blocks PROPERTIES IMPORTED_LOCATION |
| 179 | ${EXTERNAL_LIBS_DIR}/lib/monero/libblocks.a) |
| 180 | |
| 181 | add_library(checkpoints STATIC IMPORTED) |
| 182 | set_target_properties(checkpoints PROPERTIES IMPORTED_LOCATION |
| 183 | ${EXTERNAL_LIBS_DIR}/lib/monero/libcheckpoints.a) |
| 184 | |
| 185 | add_library(device STATIC IMPORTED) |
| 186 | set_target_properties(device PROPERTIES IMPORTED_LOCATION |
| 187 | ${EXTERNAL_LIBS_DIR}/lib/monero/libdevice.a) |
| 188 | |
| 189 | add_library(device_trezor STATIC IMPORTED) |
| 190 | set_target_properties(device_trezor PROPERTIES IMPORTED_LOCATION |
| 191 | ${EXTERNAL_LIBS_DIR}/lib/monero/libdevice_trezor.a) |
| 192 | |
| 193 | add_library(multisig STATIC IMPORTED) |
| 194 | set_target_properties(multisig PROPERTIES IMPORTED_LOCATION |
| 195 | ${EXTERNAL_LIBS_DIR}/lib/monero/libmultisig.a) |
| 196 | |
| 197 | add_library(version STATIC IMPORTED) |
| 198 | set_target_properties(version PROPERTIES IMPORTED_LOCATION |
| 199 | ${EXTERNAL_LIBS_DIR}/lib/monero/libversion.a) |
| 200 | |
| 201 | add_library(net STATIC IMPORTED) |
| 202 | set_target_properties(net PROPERTIES IMPORTED_LOCATION |
| 203 | ${EXTERNAL_LIBS_DIR}/lib/monero/libnet.a) |
| 204 | |
| 205 | add_library(hardforks STATIC IMPORTED) |
| 206 | set_target_properties(hardforks PROPERTIES IMPORTED_LOCATION |
| 207 | ${EXTERNAL_LIBS_DIR}/lib/monero/libhardforks.a) |
| 208 | |
| 209 | add_library(randomx STATIC IMPORTED) |
| 210 | set_target_properties(randomx PROPERTIES IMPORTED_LOCATION |
| 211 | ${EXTERNAL_LIBS_DIR}/lib/monero/librandomx.a) |
| 212 | |
| 213 | add_library(rpc_base STATIC IMPORTED) |
| 214 | set_target_properties(rpc_base PROPERTIES IMPORTED_LOCATION |
| 215 | ${EXTERNAL_LIBS_DIR}/lib/monero/librpc_base.a) |
| 216 | |
| 217 | add_library(wallet-crypto STATIC IMPORTED) |
| 218 | set_target_properties(wallet-crypto PROPERTIES IMPORTED_LOCATION |
| 219 | ${EXTERNAL_LIBS_DIR}/lib/monero/libwallet-crypto.a) |
| 220 | |
| 221 | add_library(unbound STATIC IMPORTED) |
| 222 | set_target_properties(unbound PROPERTIES IMPORTED_LOCATION |
| 223 | ${EXTERNAL_LIBS_DIR}/lib/libunbound.a) |
| 224 | |
| 225 | include_directories( ${EXTERNAL_LIBS_DIR}/include ) |
| 226 | |
| 227 | target_link_libraries( cw_monero |
| 228 | |
| 229 | wallet_api |
| 230 | wallet |
| 231 | cryptonote_core |
| 232 | cryptonote_basic |
| 233 | cryptonote_format_utils_basic |
| 234 | mnemonics |
| 235 | ringct |
| 236 | ringct_basic |
| 237 | net |
| 238 | common |
| 239 | cncrypto |
| 240 | blockchain_db |
| 241 | lmdb |
| 242 | easylogging |
| 243 | unbound |
| 244 | epee |
| 245 | blocks |
| 246 | checkpoints |
| 247 | device |
| 248 | device_trezor |
| 249 | multisig |
| 250 | version |
| 251 | randomx |
| 252 | hardforks |
| 253 | rpc_base |
| 254 | wallet-crypto |
| 255 | |
| 256 | boost_chrono |
| 257 | boost_date_time |
| 258 | boost_filesystem |
| 259 | boost_program_options |
| 260 | boost_regex |
| 261 | boost_serialization |
| 262 | boost_system |
| 263 | boost_thread |
| 264 | boost_wserialization |
| 265 | |
| 266 | ssl |
| 267 | crypto |
| 268 | |
| 269 | sodium |
| 270 | ) |