oxen-core/src/wallet/api/CMakeLists.txt

64 lines
2.2 KiB
CMake
Raw Normal View History

# Copyright (c) 2018, The Loki Project
# Copyright (c) 2014-2019, The Monero Project
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other
# materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be
# used to endorse or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cmake modernization The archaic (i.e. decade old) cmake usage here really got in the way of trying to properly use newer libraries (like lokimq), so this undertakes overhauling it considerably to make it much more sane (and significantly reduce the size). I left more of the architecture-specific bits in the top-level CMakeLists.txt intact; most of the efforts here are about properly loading dependencies, specifying dependencies and avoiding a whole pile of cmake antipatterns. This bumps the required cmake version to 3.5, which is what xenial comes with. - extensive use of interface libraries to include libraries, definitions, and include paths - use Boost::whatever instead of ${Boost_WHATEVER_LIBRARY}. The interface targets are (again) much better as they also give you any needed include or linking flags without needing to worry about them. - don't list header files when building things. This has *never* been correct cmake usage (cmake has always known how to wallet_rpc_headers the headers that .cpp files include to know about build changes). - remove the loki_add_library monstrosity; it breaks target names and makes compiling less efficient because the author couldn't figure out how to link things together. - make loki_add_executable take the output filename, and set the output path to bin/ and install to bin because *every single usage* of loki_add_executable was immediately followed by setting the output filename and setting the output path to bin/ and installing to bin. - move a bunch of crap that is only used in one particular src/whatever/CMakeLists.txt into that particular CMakeLists.txt instead of the top level CMakeLists.txt (or src/CMakeLists.txt). - Remove a bunch of redundant dependencies; most of them look like they were just copy-and-pasted in, and many more aren't needed (since they are implied by the PUBLIC linking of other dependencies). - Removed `die` since it just does a FATAL_ERROR, but adds color (which is useless since CMake already makes FATAL_ERRORs perfectly visible). - Change the way LOKI_DAEMON_AND_WALLET_ONLY works to just change the make targets to daemon and simplewallet rather than changing the build process (this should make it faster, too, since there are various other things that will be excluded).
2020-03-03 04:57:08 +01:00
add_library(wallet_api
wallet.cpp
wallet_manager.cpp
transaction_info.cpp
transaction_history.cpp
pending_transaction.cpp
utils.cpp
address_book.cpp
subaddress.cpp
subaddress_account.cpp
unsigned_transaction.cpp)
target_link_libraries(wallet_api
PUBLIC
wallet
cryptonote_core
mnemonics
cmake modernization The archaic (i.e. decade old) cmake usage here really got in the way of trying to properly use newer libraries (like lokimq), so this undertakes overhauling it considerably to make it much more sane (and significantly reduce the size). I left more of the architecture-specific bits in the top-level CMakeLists.txt intact; most of the efforts here are about properly loading dependencies, specifying dependencies and avoiding a whole pile of cmake antipatterns. This bumps the required cmake version to 3.5, which is what xenial comes with. - extensive use of interface libraries to include libraries, definitions, and include paths - use Boost::whatever instead of ${Boost_WHATEVER_LIBRARY}. The interface targets are (again) much better as they also give you any needed include or linking flags without needing to worry about them. - don't list header files when building things. This has *never* been correct cmake usage (cmake has always known how to wallet_rpc_headers the headers that .cpp files include to know about build changes). - remove the loki_add_library monstrosity; it breaks target names and makes compiling less efficient because the author couldn't figure out how to link things together. - make loki_add_executable take the output filename, and set the output path to bin/ and install to bin because *every single usage* of loki_add_executable was immediately followed by setting the output filename and setting the output path to bin/ and installing to bin. - move a bunch of crap that is only used in one particular src/whatever/CMakeLists.txt into that particular CMakeLists.txt instead of the top level CMakeLists.txt (or src/CMakeLists.txt). - Remove a bunch of redundant dependencies; most of them look like they were just copy-and-pasted in, and many more aren't needed (since they are implied by the PUBLIC linking of other dependencies). - Removed `die` since it just does a FATAL_ERROR, but adds color (which is useless since CMake already makes FATAL_ERRORs perfectly visible). - Change the way LOKI_DAEMON_AND_WALLET_ONLY works to just change the make targets to daemon and simplewallet rather than changing the build process (this should make it faster, too, since there are various other things that will be excluded).
2020-03-03 04:57:08 +01:00
lmdb
Boost::serialization
filesystem
cmake modernization The archaic (i.e. decade old) cmake usage here really got in the way of trying to properly use newer libraries (like lokimq), so this undertakes overhauling it considerably to make it much more sane (and significantly reduce the size). I left more of the architecture-specific bits in the top-level CMakeLists.txt intact; most of the efforts here are about properly loading dependencies, specifying dependencies and avoiding a whole pile of cmake antipatterns. This bumps the required cmake version to 3.5, which is what xenial comes with. - extensive use of interface libraries to include libraries, definitions, and include paths - use Boost::whatever instead of ${Boost_WHATEVER_LIBRARY}. The interface targets are (again) much better as they also give you any needed include or linking flags without needing to worry about them. - don't list header files when building things. This has *never* been correct cmake usage (cmake has always known how to wallet_rpc_headers the headers that .cpp files include to know about build changes). - remove the loki_add_library monstrosity; it breaks target names and makes compiling less efficient because the author couldn't figure out how to link things together. - make loki_add_executable take the output filename, and set the output path to bin/ and install to bin because *every single usage* of loki_add_executable was immediately followed by setting the output filename and setting the output path to bin/ and installing to bin. - move a bunch of crap that is only used in one particular src/whatever/CMakeLists.txt into that particular CMakeLists.txt instead of the top level CMakeLists.txt (or src/CMakeLists.txt). - Remove a bunch of redundant dependencies; most of them look like they were just copy-and-pasted in, and many more aren't needed (since they are implied by the PUBLIC linking of other dependencies). - Removed `die` since it just does a FATAL_ERROR, but adds color (which is useless since CMake already makes FATAL_ERRORs perfectly visible). - Change the way LOKI_DAEMON_AND_WALLET_ONLY works to just change the make targets to daemon and simplewallet rather than changing the build process (this should make it faster, too, since there are various other things that will be excluded).
2020-03-03 04:57:08 +01:00
Boost::thread
PRIVATE
cmake modernization The archaic (i.e. decade old) cmake usage here really got in the way of trying to properly use newer libraries (like lokimq), so this undertakes overhauling it considerably to make it much more sane (and significantly reduce the size). I left more of the architecture-specific bits in the top-level CMakeLists.txt intact; most of the efforts here are about properly loading dependencies, specifying dependencies and avoiding a whole pile of cmake antipatterns. This bumps the required cmake version to 3.5, which is what xenial comes with. - extensive use of interface libraries to include libraries, definitions, and include paths - use Boost::whatever instead of ${Boost_WHATEVER_LIBRARY}. The interface targets are (again) much better as they also give you any needed include or linking flags without needing to worry about them. - don't list header files when building things. This has *never* been correct cmake usage (cmake has always known how to wallet_rpc_headers the headers that .cpp files include to know about build changes). - remove the loki_add_library monstrosity; it breaks target names and makes compiling less efficient because the author couldn't figure out how to link things together. - make loki_add_executable take the output filename, and set the output path to bin/ and install to bin because *every single usage* of loki_add_executable was immediately followed by setting the output filename and setting the output path to bin/ and installing to bin. - move a bunch of crap that is only used in one particular src/whatever/CMakeLists.txt into that particular CMakeLists.txt instead of the top level CMakeLists.txt (or src/CMakeLists.txt). - Remove a bunch of redundant dependencies; most of them look like they were just copy-and-pasted in, and many more aren't needed (since they are implied by the PUBLIC linking of other dependencies). - Removed `die` since it just does a FATAL_ERROR, but adds color (which is useless since CMake already makes FATAL_ERRORs perfectly visible). - Change the way LOKI_DAEMON_AND_WALLET_ONLY works to just change the make targets to daemon and simplewallet rather than changing the build process (this should make it faster, too, since there are various other things that will be excluded).
2020-03-03 04:57:08 +01:00
extra)
set_property(TARGET wallet_api PROPERTY EXCLUDE_FROM_ALL TRUE)
if(IOS)
set(lib_folder lib-${ARCH})
else()
set(lib_folder lib)
endif()
install(FILES ${wallet_api_headers}
DESTINATION include/wallet/api)