-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor source file structure #989
Refactor source file structure #989
Conversation
I think both |
@PragmaTwice log_collector is not a network-related thing, it is a statistical thing, how about adding a |
Greate idea. I will do it. |
|
Agree with that. |
We renamed |
Current source structure:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Comments inline.
@@ -148,12 +148,12 @@ find_library(FOUND_UNWIND_LIB unwind) | |||
set(WARNING_FLAGS -Wall -Wpedantic -Wsign-compare -Wreturn-type) | |||
|
|||
# kvrocks objects target | |||
file(GLOB KVROCKS_SRCS src/*.cc) | |||
file(GLOB_RECURSE KVROCKS_SRCS src/*.cc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the build benefit from separating compile units? For example, one .o
per directory and for better incremental compilation. If it does we can implement it here or as a follow-up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is not much dependency between translation units. In theory, if there are 1000 source files, a 1000-core cpu and enough memory, we can compile completely in parallel.
list(FILTER KVROCKS_SRCS EXCLUDE REGEX src/main.cc) | ||
|
||
add_library(kvrocks_objs OBJECT ${KVROCKS_SRCS}) | ||
|
||
target_include_directories(kvrocks_objs PUBLIC src ${PROJECT_BINARY_DIR}) | ||
target_include_directories(kvrocks_objs PUBLIC src src/common ${PROJECT_BINARY_DIR}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason of this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since header files in common
is frequently used, so e.g. it can be just "status.h"
rather than "common/status.h"
.
Yes, I think it's reasonable. |
@PragmaTwice After looking detail, it seems |
Done. @git-hulk The current diff in github review page seems to be a mess, maybe because I rebase some commits. |
c3ede31
to
1d6a8ec
Compare
Solved by re-rebase and force-push. Current source structure:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PragmaTwice Good job!
LGTM (with or without src/common
among include directories)
@PragmaTwice please rebase on the latest unstable branch. @ShooterIT @caipengbo could you give a review on this patch? Perhaps we should move it forward in a timely manner to avoid further conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
e046efe
1d6a8ec
to
e046efe
Compare
Done. |
Mostly follows #977 (comment), except:
log_collector
andtls_util
is moved tonetwork/
task_runner
tocommon/