-
Notifications
You must be signed in to change notification settings - Fork 473
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
[NEW] Consider using FetchContent
instead of ExternalProject
and git submodules?
#562
Comments
FetchContent
instead of ExternalProject
and git submodules?FetchContent
instead of ExternalProject
and git submodules?
If this effort can be done, I'm glad to see a lightweight repo to be cloned and we may converge to a unified build system (CMake). WDYT @git-hulk @ShooterIT? |
Thanks @PragmaTwice @tisonkun, I think it's very great to make the build process faster. I like this improvement. |
I noticed that this project also maintains handwritten Makefiles, I think keeping only cmake will reduce the maintenance cost. |
Agree with that. I will try to keep Makefiles working in this PR. #564 (comment) |
@PragmaTwice perhaps you can think of creating a tracking issue for build system changes. In #564 we replace There is another issue #561 to be addressed in build system settings. Also, I notice that we don't have a config about CXX_STANDARD used in Kvrocks. It may help for contributors understanding which standard to follow (which features is allowed or welcomed). |
We set the CXX_STANDARD at target compile instruction, like MakeLists.txt#L78. Do you mean that's NOT obvious enough for developers? |
Great idea! I will create a tracking issue about the build system later. |
@git-hulk Sorry for missing this point. Then it's OK for me. If we encounter further confusion on c++ standard part, we can review the setting style or mention it in doc / readme. I'm OK with current status after you point it out. |
Got it. Current linter may also frustrate developers since it's not easy to run on local, since it depends on special version of cpplint and cppcheck, but won't discuss here. @PragmaTwice can help to close this issue if planning to create another issue to track the build process change. |
Ok, I'll close it. BTW, since I have some experience in static analyzer development, I am glad to give some suggestions and enhancements on lint/code analysis. |
Cool! We are very eager to improve this, thanks dude. |
Solved in #564 |
FetchContent
has been adopted by many projects as a dependency fetching method introduced in newer versions of cmake, for example the official documentation for gtest already recommends usingFetchContent
to import itself into other projects (replacing the previous recommendedExternalProject
).The advantage of
FetchContent
is that it is executed during the cmake configuration phase, which allows the configuration information of dependent projects to be introduced into the main project, unlikeExternalProject
, which is executed during the build phase.This is quite useful especially for dependency projects built with cmake, because the configured cmake target of a dependency project can be used directly in the main project via
add_subdirectory
(e.g.gtest::gtest
), instead of having to manually configure the dependency's header directories, static or shared libraries, compilation options, install directories, etc. and keeping maintaining these redundant information in the main project.This also makes git submodules unnecessary: by
FetchContent
, dependencies can be downloaded and configured at the cmake configuration stage, and URLs and commit hash/tag can be flexibly adjusted based on cmake options.There are NOT a lot of dependencies in kvrocks, and I think using
FetchContent
to manage dependencies as opposed toExternalProject
will improve the development experience. Of course, introducing a dependency manager such as vcpkg or conan may be a good option, but it introduces additional complexity in development and build management, so there is a trade-off.I'm happy to provide PRs if that sounds like a good idea.
@tisonkun
The text was updated successfully, but these errors were encountered: