chore(cmake): adopt submodule-first deps and standardize FetchContent usage #141
+369
−48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adopt a "submodule-first, FetchContent-fallback" strategy for third-party dependencies:
*_FETCHCONTENTto OFF in top-levelCMakeLists.txtand prefer pinned submodules under3rdparty/.cmake/*.cmakemodule auto-detects a local submodule and enables FetchContent only as a fallback when the submodule is absent.-Doverrides from users take precedence; a sanity check fails when the user explicitly requests both modes.Add and pin third-party submodules (commits/tags):
3rdparty/spdlog(pinned)3rdparty/fmt(pinned to 8.1.1)3rdparty/httplib(pinned to v0.22.0)3rdparty/skywalking-data-collect-protocol(pinned to v10.3.0)3rdparty/grpc(pinned to v1.74.1)Standardize FetchContent declarations:
GIT_REPOSITORY+GIT_TAG(via*_GIT_URL/*_GIT_TAGvariables) for FetchContent where appropriate so pins can be tags or commit SHAs.FetchContent_Populate.Move and tidy dependency logic:
cmake/*.cmake) to keepCMakeLists.txtlean.*_FETCHCONTENTautomatically only when the submodule is present and the user has not explicitly requested FetchContent.CI and docs:
.github/workflows/main.yml) to checkout submodules recursively and build gRPC from3rdparty/grpc.README.mddocumenting submodule-first workflow, FetchContent fallback,GIT_REPOSITORY+GIT_TAGusage, and the bump procedure.Additions and refactors:
cmake/skywalking.cmakeand exposeSKYWALKING_PROTOCOL_PATHforproto2cpp.*_GIT_URL/*_GIT_TAGvariables for maintainability.Why
-Doverrides for advanced use-cases or debugging while keeping CI deterministic.