Skip to content

Commit

Permalink
fixed loop depend problem for compile link (#1995)
Browse files Browse the repository at this point in the history
* fixed loop depend problem

* fixed error for clang9 and gcc9

* Addressed laura-ding's comment
  • Loading branch information
bright-starry-sky authored Mar 31, 2020
1 parent 4e434a5 commit f4c8361
Show file tree
Hide file tree
Showing 59 changed files with 80 additions and 50 deletions.
1 change: 1 addition & 0 deletions src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ nebula_add_subdirectory(algorithm)
nebula_add_subdirectory(encryption)
nebula_add_subdirectory(permission)
nebula_add_subdirectory(session)
nebula_add_subdirectory(utils)

4 changes: 3 additions & 1 deletion src/common/base/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

# The base_obj is a basic library. Other libraries are not allowed to depend on it.

add_library(
base_obj OBJECT
Base.cpp
Expand All @@ -6,7 +9,6 @@ add_library(
Status.cpp
SanitizerOptions.cpp
SignalHandler.cpp
NebulaKeyUtils.cpp
SlowOpTracker.cpp
)

Expand Down
7 changes: 0 additions & 7 deletions src/common/base/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,6 @@ nebula_add_test(
LIBRARIES gtest gtest_main
)

nebula_add_test(
NAME nebulakey_utils_test
SOURCES NebulaKeyUtilsTest.cpp
OBJECTS $<TARGET_OBJECTS:base_obj>
LIBRARIES gtest gtest_main
)

nebula_add_test(
NAME slow_op_tracker_test
SOURCES SlowOpTrackerTest.cpp
Expand Down
6 changes: 6 additions & 0 deletions src/common/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
nebula_add_library(
kvstore_storage_utils_obj OBJECT
NebulaKeyUtils.cpp
)

nebula_add_subdirectory(test)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/

#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"

namespace nebula {

Expand Down
File renamed without changes.
12 changes: 12 additions & 0 deletions src/common/utils/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
nebula_add_test(
NAME
nebula_key_utils_test
SOURCES
NebulaKeyUtilsTest.cpp
OBJECTS
$<TARGET_OBJECTS:base_obj>
$<TARGET_OBJECTS:kvstore_storage_utils_obj>
LIBRARIES
gtest
gtest_main
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include "base/Base.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include <gtest/gtest.h>

namespace nebula {
Expand Down
3 changes: 3 additions & 0 deletions src/daemons/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ nebula_add_executable(
$<TARGET_OBJECTS:encryption_obj>
$<TARGET_OBJECTS:session_obj>
$<TARGET_OBJECTS:permission_obj>
$<TARGET_OBJECTS:kvstore_storage_utils_obj>
LIBRARIES
proxygenhttpserver
proxygenlib
Expand Down Expand Up @@ -80,6 +81,7 @@ nebula_add_executable(
$<TARGET_OBJECTS:fs_obj>
$<TARGET_OBJECTS:stats_obj>
$<TARGET_OBJECTS:base_obj>
$<TARGET_OBJECTS:kvstore_storage_utils_obj>
LIBRARIES
proxygenhttpserver
proxygenlib
Expand Down Expand Up @@ -124,6 +126,7 @@ nebula_add_executable(
$<TARGET_OBJECTS:fs_obj>
$<TARGET_OBJECTS:base_obj>
$<TARGET_OBJECTS:encryption_obj>
$<TARGET_OBJECTS:kvstore_storage_utils_obj>
LIBRARIES
proxygenhttpserver
proxygenlib
Expand Down
1 change: 1 addition & 0 deletions src/graph/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
set(GRAPH_TEST_LIBS
$<TARGET_OBJECTS:graph_obj>
$<TARGET_OBJECTS:graph_thrift_obj>
$<TARGET_OBJECTS:kvstore_storage_utils_obj>
$<TARGET_OBJECTS:storage_service_handler>
$<TARGET_OBJECTS:storage_client>
$<TARGET_OBJECTS:storage_thrift_obj>
Expand Down
2 changes: 1 addition & 1 deletion src/kvstore/CompactionFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "base/Base.h"
#include <rocksdb/compaction_filter.h>
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include "time/WallClock.h"
#include "kvstore/Common.h"

Expand Down
2 changes: 1 addition & 1 deletion src/kvstore/Part.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "kvstore/Part.h"
#include "kvstore/LogEncoder.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include "kvstore/RocksEngineConfig.h"

DEFINE_int32(cluster_id, 0, "A unique id for each cluster");
Expand Down
2 changes: 1 addition & 1 deletion src/kvstore/Part.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define KVSTORE_PART_H_

#include "base/Base.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include "raftex/RaftPart.h"
#include "kvstore/Common.h"
#include "kvstore/KVEngine.h"
Expand Down
2 changes: 1 addition & 1 deletion src/kvstore/SnapshotManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
#include "kvstore/SnapshotManagerImpl.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include "kvstore/LogEncoder.h"

DEFINE_int32(snapshot_batch_size, 1024 * 1024 * 10, "batch size for snapshot");
Expand Down
2 changes: 1 addition & 1 deletion src/kvstore/plugins/hbase/HBaseStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include "base/Base.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include "network/NetworkUtils.h"
#include "dataman/NebulaCodecImpl.h"
#include "kvstore/plugins/hbase/HBaseStore.h"
Expand Down
2 changes: 2 additions & 0 deletions src/kvstore/plugins/hbase/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ nebula_add_test(
$<TARGET_OBJECTS:time_obj>
$<TARGET_OBJECTS:meta_thrift_obj>
$<TARGET_OBJECTS:gflags_man_obj>
$<TARGET_OBJECTS:kvstore_storage_utils_obj>
LIBRARIES
${ROCKSDB_LIBRARIES}
${THRIFT_LIBRARIES}
Expand Down Expand Up @@ -50,6 +51,7 @@ nebula_add_test(
$<TARGET_OBJECTS:meta_thrift_obj>
$<TARGET_OBJECTS:adHocSchema_obj>
$<TARGET_OBJECTS:gflags_man_obj>
$<TARGET_OBJECTS:kvstore_storage_utils_obj>
LIBRARIES
${ROCKSDB_LIBRARIES}
${THRIFT_LIBRARIES}
Expand Down
2 changes: 1 addition & 1 deletion src/kvstore/plugins/hbase/test/HBaseStoreTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include "base/Base.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include "dataman/RowReader.h"
#include "dataman/RowWriter.h"
#include "kvstore/plugins/hbase/HBaseStore.h"
Expand Down
2 changes: 1 addition & 1 deletion src/kvstore/raftex/SnapshotManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
#include "kvstore/raftex/SnapshotManager.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include "kvstore/raftex/RaftPart.h"

DEFINE_int32(snapshot_worker_threads, 4, "Threads number for snapshot");
Expand Down
1 change: 1 addition & 0 deletions src/kvstore/raftex/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set(RAFTEX_TEST_LIBS
$<TARGET_OBJECTS:network_obj>
$<TARGET_OBJECTS:thrift_obj>
$<TARGET_OBJECTS:time_obj>
$<TARGET_OBJECTS:kvstore_storage_utils_obj>
)


Expand Down
2 changes: 2 additions & 0 deletions src/kvstore/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ set(KVSTORE_TEST_LIBS
$<TARGET_OBJECTS:thrift_obj>
$<TARGET_OBJECTS:time_obj>
$<TARGET_OBJECTS:gflags_man_obj>
$<TARGET_OBJECTS:kvstore_storage_utils_obj>
)

nebula_add_test(
Expand Down Expand Up @@ -77,6 +78,7 @@ nebula_add_test(
$<TARGET_OBJECTS:network_obj>
$<TARGET_OBJECTS:thrift_obj>
$<TARGET_OBJECTS:time_obj>
$<TARGET_OBJECTS:kvstore_storage_utils_obj>
LIBRARIES
${THRIFT_LIBRARIES}
${ROCKSDB_LIBRARIES}
Expand Down
1 change: 1 addition & 0 deletions src/meta/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ set(meta_test_deps
$<TARGET_OBJECTS:network_obj>
$<TARGET_OBJECTS:thread_obj>
$<TARGET_OBJECTS:base_obj>
$<TARGET_OBJECTS:kvstore_storage_utils_obj>
)

nebula_add_test(
Expand Down
2 changes: 1 addition & 1 deletion src/storage/CompactionFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define STORAGE_COMPACTIONFILTER_H_

#include "base/Base.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include "dataman/RowReader.h"
#include "meta/NebulaSchemaProvider.h"
#include "kvstore/CompactionFilter.h"
Expand Down
2 changes: 1 addition & 1 deletion src/storage/index/IndexPolicyMaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include "storage/index/IndexPolicyMaker.h"
#include "common/base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"

namespace nebula {
namespace storage {
Expand Down
2 changes: 1 addition & 1 deletion src/storage/kv/GetProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include "storage/kv/GetProcessor.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"

namespace nebula {
namespace storage {
Expand Down
2 changes: 1 addition & 1 deletion src/storage/mutate/AddEdgesProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
#include "storage/mutate/AddEdgesProcessor.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include <algorithm>
#include <limits>
#include "time/WallClock.h"
Expand Down
2 changes: 1 addition & 1 deletion src/storage/mutate/AddVerticesProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include "storage/mutate/AddVerticesProcessor.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include <algorithm>
#include <limits>
#include "time/WallClock.h"
Expand Down
2 changes: 1 addition & 1 deletion src/storage/mutate/DeleteEdgesProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "storage/mutate/DeleteEdgesProcessor.h"
#include <algorithm>
#include <limits>
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"

namespace nebula {
namespace storage {
Expand Down
2 changes: 1 addition & 1 deletion src/storage/mutate/DeleteVerticesProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include "storage/mutate/DeleteVerticesProcessor.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"

DECLARE_bool(enable_vertex_cache);

Expand Down
2 changes: 1 addition & 1 deletion src/storage/mutate/UpdateEdgeProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include "storage/mutate/UpdateEdgeProcessor.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include "dataman/RowWriter.h"
#include "kvstore/LogEncoder.h"

Expand Down
2 changes: 1 addition & 1 deletion src/storage/mutate/UpdateVertexProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "base/Base.h"
#include "storage/mutate/UpdateVertexProcessor.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include "dataman/RowWriter.h"
#include "kvstore/LogEncoder.h"

Expand Down
2 changes: 1 addition & 1 deletion src/storage/query/QueryBaseProcessor.inl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
#include "storage/query/QueryBaseProcessor.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include <algorithm>
#include "dataman/RowReader.h"
#include "dataman/RowWriter.h"
Expand Down
2 changes: 1 addition & 1 deletion src/storage/query/QueryEdgePropsProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include "storage/query/QueryEdgePropsProcessor.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include <algorithm>
#include "time/Duration.h"
#include "dataman/RowReader.h"
Expand Down
2 changes: 1 addition & 1 deletion src/storage/query/ScanEdgeProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
#include "storage/query/ScanEdgeProcessor.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include <algorithm>
#include <limits>
#include "time/WallClock.h"
Expand Down
2 changes: 1 addition & 1 deletion src/storage/query/ScanVertexProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
#include "storage/query/ScanVertexProcessor.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include <algorithm>
#include <limits>
#include "time/WallClock.h"
Expand Down
2 changes: 1 addition & 1 deletion src/storage/test/AddEdgesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include "base/Base.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include <gtest/gtest.h>
#include <rocksdb/db.h>
#include "fs/TempDir.h"
Expand Down
2 changes: 1 addition & 1 deletion src/storage/test/AddVerticesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include "base/Base.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include <gtest/gtest.h>
#include <rocksdb/db.h>
#include "fs/TempDir.h"
Expand Down
1 change: 1 addition & 0 deletions src/storage/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set(storage_test_deps
$<TARGET_OBJECTS:kvstore_storage_utils_obj>
$<TARGET_OBJECTS:storage_service_handler>
$<TARGET_OBJECTS:filter_obj>
$<TARGET_OBJECTS:storage_client>
Expand Down
2 changes: 1 addition & 1 deletion src/storage/test/CompactionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include "base/Base.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include <gtest/gtest.h>
#include <folly/synchronization/Baton.h>
#include "fs/TempDir.h"
Expand Down
2 changes: 1 addition & 1 deletion src/storage/test/DeleteEdgesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "storage/test/TestUtils.h"
#include "storage/mutate/DeleteEdgesProcessor.h"
#include "storage/mutate/AddEdgesProcessor.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"


namespace nebula {
Expand Down
2 changes: 1 addition & 1 deletion src/storage/test/DeleteVerticesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "storage/test/TestUtils.h"
#include "storage/mutate/DeleteVerticesProcessor.h"
#include "storage/mutate/AddVerticesProcessor.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"


namespace nebula {
Expand Down
2 changes: 1 addition & 1 deletion src/storage/test/IndexScanTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include "base/Base.h"
#include "base/NebulaKeyUtils.h"
#include "utils/NebulaKeyUtils.h"
#include <gtest/gtest.h>
#include <rocksdb/db.h>
#include <limits>
Expand Down
Loading

0 comments on commit f4c8361

Please sign in to comment.