CMakeLists.txt raw
1 # Copyright (c) 2023-present The Limenka developers
2 # Distributed under the MIT software license, see the accompanying
3 # file COPYING or https://opensource.org/license/mit/.
4
5 add_library(test_util STATIC EXCLUDE_FROM_ALL
6 blockfilter.cpp
7 coins.cpp
8 index.cpp
9 json.cpp
10 logging.cpp
11 mining.cpp
12 net.cpp
13 random.cpp
14 script.cpp
15 setup_common.cpp
16 str.cpp
17 transaction_utils.cpp
18 txmempool.cpp
19 validation.cpp
20 $<$<BOOL:${ENABLE_WALLET}>:${PROJECT_SOURCE_DIR}/src/wallet/test/util.cpp>
21 )
22
23 target_link_libraries(test_util
24 PRIVATE
25 core_interface
26 Boost::headers
27 PUBLIC
28 univalue
29 )
30
31 function(make_liblimenkaconsensus_dll_available target)
32 if(TARGET limenkaconsensus AND WIN32 AND BUILD_SHARED_LIBS)
33 # The DLL must reside either in the same folder where the executable is
34 # or somewhere in PATH. Using the former option.
35 add_custom_command(
36 TARGET ${target} POST_BUILD
37 COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:limenkaconsensus> $<TARGET_FILE_DIR:${target}>
38 VERBATIM
39 )
40 endif()
41 endfunction()
42