Skip to content

Commit

Permalink
Fix cmake typo
Browse files Browse the repository at this point in the history
Signed-off-by: yhmo <[email protected]>
  • Loading branch information
yhmo committed Jan 16, 2025
1 parent f5760ce commit c536636
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 11 deletions.
44 changes: 38 additions & 6 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
misc:
- branch: &BRANCHES
# In this pull request, the changes are based on the master branch
- &MASTER_BRANCH base=master
# In this pull request, the changes are based on the 2.x(or 2.x.x) branch
- &2X_BRANCH base~=^2(\.\d+){1,2}$

pull_request_rules:
- name: Add needs-dco label when DCO check failed
conditions:
# branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
- or: *BRANCHES
- -status-success=DCO
actions:
label:
remove:
- dco-passed
add:
- needs-dco
comment:
message: |
@{{author}} Thanks for your contribution. Please submit with DCO, see the contributing guide https://github.com/milvus-io/milvus/blob/master/CONTRIBUTING.md#developer-certificate-of-origin-dco.
- name: Add dco-passed label when DCO check passed
conditions:
# branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES
- or: *BRANCHES
- status-success=DCO
actions:
label:
remove:
- needs-dco
add:
- dco-passed

- name: Test passed for code changed
conditions:
- base=master
- or: *BRANCHES
- "status-success=Build and test AMD64 Ubuntu 20.04"
- "status-success=Build and test AMD64 Ubuntu 22.04"
- "status-success=Build and test AMD64 Fedora 38"
Expand All @@ -15,7 +49,7 @@ pull_request_rules:

- name: Remove ci-passed when build failed
conditions:
- base=master
- or: *BRANCHES
- or:
- "check-failure=Build and test AMD64 Ubuntu 20.04"
- "check-failure=Build and test AMD64 Ubuntu 22.04"
Expand All @@ -30,14 +64,12 @@ pull_request_rules:

- name: Add ci-passed when no code changes
conditions:
- base=master
- or: *BRANCHES
- or:
# all path not in source pattern
# try keep same as in .github/workflows/main.yaml
- and:
- -files~=^(cmake|examples|scripts|src|test|thirdparty)\/.*$
- -files~=^\.github\/workflows\/main.yaml$
- -files~=^\.clang-(tidy|format)$
- -files~=^(cmake|examples|doc/thirdparty)\/.*$
# only .md files changed
- -files~=^.*(?<!\.md)$
actions:
Expand Down
4 changes: 2 additions & 2 deletions cmake/MilvusProtoGen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ set(PROTO_BINARY_DIR "${milvus_proto_BINARY_DIR}")
set(PROTO_IMPORT_DIR "${milvus_proto_SOURCE_DIR}/proto")

# resolve protoc, always use the protoc in the build tree
set(Protobuf_PROTOC_EXECUTABLE $<TARGET_FILE:protoc>)
set(Protobuf_PROTOC_EXECUTABLE $<TARGET_FILE:protobuf::protoc>)
message(STATUS "using protoc: ${Protobuf_PROTOC_EXECUTABLE}")

# resolve grpc_cpp_plugin
set(GRPC_CPP_PLUGIN $<TARGET_FILE:grpc_cpp_plugin>)
set(GRPC_CPP_PLUGIN $<TARGET_FILE:gRPC::grpc_cpp_plugin>)
message(STATUS "using grpc_cpp_plugin: ${GRPC_CPP_PLUGIN}")


Expand Down
13 changes: 11 additions & 2 deletions cmake/ThirdPartyPackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,40 @@ include(FetchContent)
set(GRPC_VERSION 1.49.1)
set(NLOHMANN_JSON_VERSION 3.11.3)
set(GOOGLETEST_VERSION 1.12.1)
Set(FETCHCONTENT_QUIET FALSE)

# grpc
FetchContent_Declare(
grpc
GIT_REPOSITORY https://github.com/grpc/grpc.git
GIT_TAG v${GRPC_VERSION}
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)

# nlohmann_json
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v${NLOHMANN_JSON_VERSION}
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)

# googletest
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-${GOOGLETEST_VERSION}
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)


# grpc
if ("${MILVUS_WITH_GRPC}" STREQUAL "pakcage")
find_package(grpc REQUIRED)
if ("${MILVUS_WITH_GRPC}" STREQUAL "package")
find_package(Protobuf REQUIRED)
find_package(gRPC REQUIRED)
else ()
if (WIN32)
set(OPENSSL_NO_ASM_TXT "YES")
Expand All @@ -66,6 +74,7 @@ else ()
set(ABSL_PROPAGATE_CXX_STD ON CACHE INTERNAL "")
add_subdirectory(${grpc_SOURCE_DIR} ${grpc_BINARY_DIR} EXCLUDE_FROM_ALL)
add_library(gRPC::grpc++ ALIAS grpc++)
add_executable(gRPC::grpc_cpp_plugin ALIAS grpc_cpp_plugin)
endif ()
endif ()

Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../src/impl)
include_directories(${milvus_proto_BINARY_DIR})

# resolve gtest
if ("${MILVUS_WITH_GTEST}" STREQUAL "pakcage")
if ("${MILVUS_WITH_GTEST}" STREQUAL "package")
find_package(GTest REQUIRED)
else ()
if (NOT googletest_POPULATED)
Expand Down

0 comments on commit c536636

Please sign in to comment.