Debian Codegraph @

src/device_trezor/CMakeLists.txt

raw
1 # Copyright (c) 2014-2022, The Monero Project
2 #
3 # All rights reserved.
4 #
5 # Redistribution and use in source and binary forms, with or without modification, are
6 # permitted provided that the following conditions are met:
7 #
8 # 1. Redistributions of source code must retain the above copyright notice, this list of
9 # conditions and the following disclaimer.
10 #
11 # 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 # of conditions and the following disclaimer in the documentation and/or other
13 # materials provided with the distribution.
14 #
15 # 3. Neither the name of the copyright holder nor the names of its contributors may be
16 # used to endorse or promote products derived from this software without specific
17 # prior written permission.
18 #
19 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 # THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27 # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 set(TREZOR_PROTOB_H
30 trezor/messages/messages.pb.h
31 trezor/messages/messages-common.pb.h
32 trezor/messages/messages-management.pb.h
33 trezor/messages/messages-monero.pb.h
34 )
35
36 set(TREZOR_PROTOB_CPP
37 trezor/messages/messages.pb.cc
38 trezor/messages/messages-common.pb.cc
39 trezor/messages/messages-management.pb.cc
40 trezor/messages/messages-monero.pb.cc
41 )
42
43 set(trezor_headers
44 trezor/exceptions.hpp
45 trezor/messages_map.hpp
46 trezor/protocol.hpp
47 trezor/transport.hpp
48 device_trezor_base.hpp
49 device_trezor.hpp
50 trezor.hpp
51 ${TREZOR_PROTOB_H}
52 )
53
54 set(trezor_sources
55 trezor/messages_map.cpp
56 trezor/protocol.cpp
57 trezor/transport.cpp
58 device_trezor_base.cpp
59 device_trezor.cpp
60 ${TREZOR_PROTOB_CPP}
61 )
62
63 set(trezor_private_headers)
64
65
66 # Protobuf and LibUSB processed by CheckTrezor
67 if(DEVICE_TREZOR_READY)
68 message(STATUS "Trezor support enabled")
69
70 if(USE_DEVICE_TREZOR_DEBUG)
71 list(APPEND trezor_headers trezor/debug_link.hpp trezor/messages/messages-debug.pb.h)
72 list(APPEND trezor_sources trezor/debug_link.cpp trezor/messages/messages-debug.pb.cc)
73 message(STATUS "Trezor debugging enabled")
74 endif()
75
76 monero_private_headers(device_trezor
77 ${device_private_headers})
78
79 monero_add_library(device_trezor
80 ${trezor_sources}
81 ${trezor_headers}
82 ${trezor_private_headers})
83
84 target_link_libraries(device_trezor
85 PUBLIC
86 device
87 cncrypto
88 ringct_basic
89 cryptonote_core
90 common
91 ${SODIUM_LIBRARY}
92 ${Boost_CHRONO_LIBRARY}
93 ${Protobuf_LIBRARY}
94 ${TREZOR_LIBUSB_LIBRARIES}
95 PRIVATE
96 ${EXTRA_LIBRARIES})
97
98 else()
99 message(STATUS "Trezor support disabled")
100 monero_private_headers(device_trezor)
101 monero_add_library(device_trezor device_trezor.cpp)
102 target_link_libraries(device_trezor PUBLIC cncrypto)
103 endif()