Skip to content

Commit 396c704

Browse files
Harrmkamilsa
authored andcommitted
Refactor Outcome target (#6)
Signed-off-by: Harrm <[email protected]>
1 parent 5c2bace commit 396c704

File tree

12 files changed

+19
-26
lines changed

12 files changed

+19
-26
lines changed

core/common/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ target_link_libraries(blob
2020
hexutil
2121
)
2222

23+
add_library(outcome INTERFACE)
24+
target_link_libraries(outcome INTERFACE
25+
Boost::boost
26+
p2p::p2p
27+
)
28+
2329
add_library(buffer
2430
buffer.hpp
2531
buffer.cpp

core/common/buffer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
#include <boost/container_hash/hash.hpp>
1010
#include <boost/operators.hpp>
1111
#include <gsl/span>
12-
#include <outcome/outcome.hpp>
1312
#include <string_view>
1413
#include <vector>
14+
#include "common/outcome.hpp"
1515

1616
namespace fc::common {
1717

core/common/hexutil.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <vector>
1111

1212
#include <gsl/span>
13-
#include <outcome/outcome.hpp>
13+
#include "common/outcome.hpp"
1414

1515
namespace fc::common {
1616

deps/outcome/outcome/outcome.hpp renamed to core/common/outcome.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
#ifndef CPP_FILECOIN_DEPS_OUTCOME_OUTCOME_OUTCOME_HPP
7-
#define CPP_FILECOIN_DEPS_OUTCOME_OUTCOME_OUTCOME_HPP
6+
#ifndef CPP_FILECOIN_CORE_COMMON_OUTCOME_HPP
7+
#define CPP_FILECOIN_CORE_COMMON_OUTCOME_HPP
88

99
#include <libp2p/outcome/outcome.hpp>
1010

11-
namespace outcome {
11+
namespace fc::outcome {
1212
using libp2p::outcome::failure;
1313
using libp2p::outcome::result;
1414
using libp2p::outcome::success;
15-
} // namespace outcome
15+
} // namespace fc::outcome
1616

17-
#endif // CPP_FILECOIN_DEPS_OUTCOME_OUTCOME_OUTCOME_HPP
17+
#endif // CPP_FILECOIN_CORE_COMMON_OUTCOME_HPP

core/storage/face/readable_map.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#ifndef CPP_FILECOIN_READABLE_MAP_HPP
77
#define CPP_FILECOIN_READABLE_MAP_HPP
88

9-
#include <outcome/outcome.hpp>
9+
#include "common/outcome.hpp"
1010
#include "storage/face/map_cursor.hpp"
1111

1212
namespace fc::storage::face {

core/storage/face/writeable_map.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#ifndef CPP_FILECOIN_WRITEABLE_MAP_HPP
77
#define CPP_FILECOIN_WRITEABLE_MAP_HPP
88

9-
#include <outcome/outcome.hpp>
9+
#include "common/outcome.hpp"
1010

1111
namespace fc::storage::face {
1212

core/storage/in_memory/in_memory_storage.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <memory>
1010

11-
#include <outcome/outcome.hpp>
11+
#include "common/outcome.hpp"
1212
#include "common/buffer.hpp"
1313
#include "storage/face/persistent_map.hpp"
1414

core/storage/leveldb/leveldb_error.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#ifndef CPP_FILECOIN_LEVELDB_ERROR_HPP
77
#define CPP_FILECOIN_LEVELDB_ERROR_HPP
88

9-
#include <outcome/outcome.hpp>
9+
#include "common/outcome.hpp"
1010

1111
namespace fc::storage {
1212

core/storage/leveldb/leveldb_util.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <leveldb/status.h>
1010
#include <gsl/span>
11-
#include <outcome/outcome.hpp>
11+
#include "common/outcome.hpp"
1212
#include "common/buffer.hpp"
1313
#include "common/logger.hpp"
1414
#include "storage/leveldb/leveldb_error.hpp"

deps/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
33
# SPDX-License-Identifier: Apache-2.0
44
#
5-
6-
add_subdirectory(outcome)

deps/outcome/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +0,0 @@
1-
#
2-
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
3-
# SPDX-License-Identifier: Apache-2.0
4-
#
5-
6-
add_library(outcome INTERFACE IMPORTED GLOBAL)
7-
set_target_properties(outcome PROPERTIES
8-
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_LIST_DIR}
9-
INTERFACE_LINK_LIBRARIES Boost::boost
10-
INTERFACE_LINK_LIBRARIES p2p::p2p
11-
)

test/testutil/outcome.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#define CPP_FILECOIN_GTEST_OUTCOME_UTIL_HPP
88

99
#include <gtest/gtest.h>
10-
#include <outcome/outcome.hpp>
10+
#include "common/outcome.hpp"
1111
#include "common/visitor.hpp"
1212

1313
#define PP_CAT(a, b) PP_CAT_I(a, b)

0 commit comments

Comments
 (0)