Debian Codegraph @

contrib/epee/src/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(EPEE_INCLUDE_DIR_BASE "${CMAKE_CURRENT_SOURCE_DIR}/../include")
30
31 # Add headers to the file list, to be able to search for them and autosave in IDEs.
32 monero_find_all_headers(EPEE_HEADERS_PUBLIC "${EPEE_INCLUDE_DIR_BASE}")
33
34 monero_add_library(epee byte_slice.cpp byte_stream.cpp hex.cpp abstract_http_client.cpp http_auth.cpp mlog.cpp net_helper.cpp net_utils_base.cpp string_tools.cpp parserse_base_utils.cpp
35 wipeable_string.cpp levin_base.cpp memwipe.c connection_basic.cpp network_throttle.cpp network_throttle-detail.cpp mlocker.cpp buffer.cpp net_ssl.cpp
36 int-util.cpp portable_storage.cpp
37 misc_language.cpp
38 file_io_utils.cpp
39 net_parse_helpers.cpp
40 http_base.cpp
41 ${EPEE_HEADERS_PUBLIC}
42 )
43
44 if (USE_READLINE AND (GNU_READLINE_FOUND OR (DEPENDS AND NOT MINGW)))
45 monero_add_library(epee_readline readline_buffer.cpp)
46 endif()
47
48 set_property(SOURCE memwipe.c PROPERTY C_STANDARD 11)
49
50 # Build and install libepee if we're building for GUI
51 if (BUILD_GUI_DEPS)
52 if(IOS)
53 set(lib_folder lib-${ARCH})
54 else()
55 set(lib_folder lib)
56 endif()
57 install(TARGETS epee
58 ARCHIVE DESTINATION ${lib_folder})
59 if (USE_READLINE AND GNU_READLINE_FOUND)
60 install(TARGETS epee_readline
61 ARCHIVE DESTINATION ${lib_folder})
62 endif()
63 endif()
64
65 target_link_libraries(epee
66 PUBLIC
67 easylogging
68 ${Boost_CHRONO_LIBRARY}
69 ${Boost_FILESYSTEM_LIBRARY}
70 ${Boost_THREAD_LIBRARY}
71 ${Boost_REGEX_LIBRARY}
72 ${Boost_SYSTEM_LIBRARY}
73 ${OPENSSL_LIBRARIES}
74 PRIVATE
75 ${EXTRA_LIBRARIES})
76
77 if (USE_READLINE AND (GNU_READLINE_FOUND OR (DEPENDS AND NOT MINGW)))
78 target_link_libraries(epee_readline
79 PUBLIC
80 easylogging
81 ${Boost_SYSTEM_LIBRARY}
82 PRIVATE
83 ${GNU_READLINE_LIBRARY})
84 endif()
85
86 target_include_directories(epee
87 PUBLIC
88 "${EPEE_INCLUDE_DIR_BASE}"
89 "${OPENSSL_INCLUDE_DIR}")
90