cmake, test: Improve locality of bitcoin_ipc_test library description
This commit is contained in:
8 files changed
+38
-38
No files matched your search
@@ -325,22 +325,6 @@ if(ENABLE_IPC AND BUILD_DAEMON)
|
|||||||
install_binary_component(bitcoin-node INTERNAL)
|
install_binary_component(bitcoin-node INTERNAL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_IPC AND BUILD_TESTS)
|
|
||||||
# bitcoin_ipc_test library target is defined here in src/CMakeLists.txt
|
|
||||||
# instead of src/test/CMakeLists.txt so capnp files in src/test/ are able to
|
|
||||||
# reference capnp files in src/ipc/capnp/ by relative path. The Cap'n Proto
|
|
||||||
# compiler only allows importing by relative path when the importing and
|
|
||||||
# imported files are underneath the same compilation source prefix, so the
|
|
||||||
# source prefix must be src/, not src/test/
|
|
||||||
add_library(bitcoin_ipc_test STATIC EXCLUDE_FROM_ALL
|
|
||||||
test/ipc_test.cpp
|
|
||||||
)
|
|
||||||
target_capnp_sources(bitcoin_ipc_test ${PROJECT_SOURCE_DIR}
|
|
||||||
test/ipc_test.capnp
|
|
||||||
)
|
|
||||||
add_dependencies(bitcoin_ipc_test bitcoin_ipc_headers)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
add_library(bitcoin_cli STATIC EXCLUDE_FROM_ALL
|
add_library(bitcoin_cli STATIC EXCLUDE_FROM_ALL
|
||||||
compat/stdin.cpp
|
compat/stdin.cpp
|
||||||
|
|||||||
+24
-1
@@ -9,7 +9,7 @@ add_library(bitcoin_ipc STATIC EXCLUDE_FROM_ALL
|
|||||||
process.cpp
|
process.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_capnp_sources(bitcoin_ipc ${PROJECT_SOURCE_DIR}
|
target_capnp_sources(bitcoin_ipc ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
capnp/common.capnp
|
capnp/common.capnp
|
||||||
capnp/echo.capnp
|
capnp/echo.capnp
|
||||||
capnp/init.capnp
|
capnp/init.capnp
|
||||||
@@ -22,4 +22,27 @@ target_link_libraries(bitcoin_ipc
|
|||||||
univalue
|
univalue
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(BUILD_TESTS)
|
||||||
|
# bitcoin_ipc_test library target is defined here in src/ipc/CMakeLists.txt
|
||||||
|
# instead of src/ipc/test/CMakeLists.txt so capnp files in src/ipc/test/ are able to
|
||||||
|
# reference capnp files in src/ipc/capnp/ by relative path. The Cap'n Proto
|
||||||
|
# compiler only allows importing by relative path when the importing and
|
||||||
|
# imported files are underneath the same compilation source prefix, so the
|
||||||
|
# source prefix must be src/ipc, not src/ipc/test/
|
||||||
|
add_library(bitcoin_ipc_test STATIC EXCLUDE_FROM_ALL
|
||||||
|
test/ipc_test.cpp
|
||||||
|
)
|
||||||
|
target_capnp_sources(bitcoin_ipc_test ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
test/ipc_test.capnp
|
||||||
|
)
|
||||||
|
add_dependencies(bitcoin_ipc_test bitcoin_ipc_headers)
|
||||||
|
|
||||||
|
target_link_libraries(bitcoin_ipc_test
|
||||||
|
PRIVATE
|
||||||
|
core_interface
|
||||||
|
univalue
|
||||||
|
Boost::headers
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
configure_file(.clang-tidy.in .clang-tidy USE_SOURCE_PERMISSIONS COPYONLY)
|
configure_file(.clang-tidy.in .clang-tidy USE_SOURCE_PERMISSIONS COPYONLY)
|
||||||
@@ -2,13 +2,6 @@
|
|||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or https://opensource.org/license/mit/.
|
# file COPYING or https://opensource.org/license/mit/.
|
||||||
|
|
||||||
target_link_libraries(bitcoin_ipc_test
|
|
||||||
PRIVATE
|
|
||||||
core_interface
|
|
||||||
univalue
|
|
||||||
Boost::headers
|
|
||||||
)
|
|
||||||
|
|
||||||
# Do not use generator expressions in test sources because the
|
# Do not use generator expressions in test sources because the
|
||||||
# SOURCES property is processed to gather test suite macros.
|
# SOURCES property is processed to gather test suite macros.
|
||||||
target_sources(test_bitcoin
|
target_sources(test_bitcoin
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ using Cxx = import "/capnp/c++.capnp";
|
|||||||
$Cxx.namespace("gen");
|
$Cxx.namespace("gen");
|
||||||
|
|
||||||
using Proxy = import "/mp/proxy.capnp";
|
using Proxy = import "/mp/proxy.capnp";
|
||||||
$Proxy.include("test/ipc_test.h");
|
$Proxy.include("ipc/test/ipc_test.h");
|
||||||
$Proxy.includeTypes("test/ipc_test_types.h");
|
$Proxy.includeTypes("ipc/test/ipc_test_types.h");
|
||||||
|
|
||||||
using Mining = import "../ipc/capnp/mining.capnp";
|
using Mining = import "../capnp/mining.capnp";
|
||||||
|
|
||||||
interface FooInterface $Proxy.wrap("FooImplementation") {
|
interface FooInterface $Proxy.wrap("FooImplementation") {
|
||||||
add @0 (a :Int32, b :Int32) -> (result :Int32);
|
add @0 (a :Int32, b :Int32) -> (result :Int32);
|
||||||
@@ -8,9 +8,9 @@
|
|||||||
#include <ipc/protocol.h>
|
#include <ipc/protocol.h>
|
||||||
#include <logging.h>
|
#include <logging.h>
|
||||||
#include <mp/proxy-types.h>
|
#include <mp/proxy-types.h>
|
||||||
#include <test/ipc_test.capnp.h>
|
#include <ipc/test/ipc_test.capnp.h>
|
||||||
#include <test/ipc_test.capnp.proxy.h>
|
#include <ipc/test/ipc_test.capnp.proxy.h>
|
||||||
#include <test/ipc_test.h>
|
#include <ipc/test/ipc_test.h>
|
||||||
#include <tinyformat.h>
|
#include <tinyformat.h>
|
||||||
#include <validation.h>
|
#include <validation.h>
|
||||||
|
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
// Distributed under the MIT software license, see the accompanying
|
// Distributed under the MIT software license, see the accompanying
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
#ifndef BITCOIN_TEST_IPC_TEST_H
|
#ifndef BITCOIN_IPC_TEST_IPC_TEST_H
|
||||||
#define BITCOIN_TEST_IPC_TEST_H
|
#define BITCOIN_IPC_TEST_IPC_TEST_H
|
||||||
|
|
||||||
#include <primitives/transaction.h>
|
#include <primitives/transaction.h>
|
||||||
#include <script/script.h>
|
#include <script/script.h>
|
||||||
@@ -27,4 +27,4 @@ void IpcPipeTest();
|
|||||||
void IpcSocketPairTest();
|
void IpcSocketPairTest();
|
||||||
void IpcSocketTest(const fs::path& datadir);
|
void IpcSocketTest(const fs::path& datadir);
|
||||||
|
|
||||||
#endif // BITCOIN_TEST_IPC_TEST_H
|
#endif // BITCOIN_IPC_TEST_IPC_TEST_H
|
||||||
@@ -2,11 +2,11 @@
|
|||||||
// Distributed under the MIT software license, see the accompanying
|
// Distributed under the MIT software license, see the accompanying
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
#ifndef BITCOIN_TEST_IPC_TEST_TYPES_H
|
#ifndef BITCOIN_IPC_TEST_IPC_TEST_TYPES_H
|
||||||
#define BITCOIN_TEST_IPC_TEST_TYPES_H
|
#define BITCOIN_IPC_TEST_IPC_TEST_TYPES_H
|
||||||
|
|
||||||
#include <ipc/capnp/common-types.h>
|
#include <ipc/capnp/common-types.h>
|
||||||
#include <ipc/capnp/mining-types.h>
|
#include <ipc/capnp/mining-types.h>
|
||||||
#include <test/ipc_test.capnp.h>
|
#include <ipc/test/ipc_test.capnp.h>
|
||||||
|
|
||||||
#endif // BITCOIN_TEST_IPC_TEST_TYPES_H
|
#endif // BITCOIN_IPC_TEST_IPC_TEST_TYPES_H
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
#include <ipc/process.h>
|
#include <ipc/process.h>
|
||||||
#include <test/ipc_test.h>
|
#include <ipc/test/ipc_test.h>
|
||||||
|
|
||||||
#include <test/util/setup_common.h>
|
#include <test/util/setup_common.h>
|
||||||
#include <boost/test/unit_test.hpp>
|
#include <boost/test/unit_test.hpp>
|
||||||
|
|||||||
Reference in new issue
Block a user