diff --git a/.github/workflows/cpp-ci.yml b/.github/workflows/cpp-ci.yml index ab5e863..0362506 100644 --- a/.github/workflows/cpp-ci.yml +++ b/.github/workflows/cpp-ci.yml @@ -52,7 +52,7 @@ jobs: make check-tidy - name : Test - working-directory: ./cpp/build/Release + working-directory: ./cpp/build/test run: ctest . diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 9167769..ef2c798 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -7,6 +7,7 @@ option(WITH_ASAN "Build with address sanitizer." OFF) option(WITH_OPENDAL "Build with opendal." OFF) set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") diff --git a/cpp/Makefile b/cpp/Makefile index 39818f6..3f03fb6 100644 --- a/cpp/Makefile +++ b/cpp/Makefile @@ -6,20 +6,20 @@ ifneq ($(TIDY_THREADS),) endif build: - mkdir -p build && cd build && \ - conan install .. --build=missing && \ - conan build .. + mkdir -p build/release && cd build/release && \ + cmake ../.. && \ + make -j 8 debug: mkdir -p build && cd build && \ - conan install .. --build=missing -s build_type=Debug && \ - conan build .. + cmake -DCMAKE_BUILD_TYPE=Debug .. && \ + make -j 8 clean: rm -rf build test: build - cd build/Release && ctest . -j ${TEST_THREADS} --output-on-failure + cd build/test && ctest . -j ${TEST_THREADS} --output-on-failure fix-format: find ./src -type f ! -name "*.pb.h" -iname *.h -o -iname *.cpp | xargs clang-format -i @@ -32,10 +32,10 @@ check-format: find ./test -type f ! -name "*.pb.h" -iname *.h -o -iname *.cpp | xargs clang-format --dry-run --Werror check-tidy: - python3 ./scripts/run-clang-tidy.py -p build/Release + python3 ./scripts/run-clang-tidy.py -p build fix-tidy: - python3 ./scripts/run-clang-tidy.py -fix -p build/Release + python3 ./scripts/run-clang-tidy.py -fix -p build proto: protoc -I="src/proto" --cpp_out="src/proto" src/proto/*.proto diff --git a/cpp/test/CMakeLists.txt b/cpp/test/CMakeLists.txt index 4092758..b4c8192 100644 --- a/cpp/test/CMakeLists.txt +++ b/cpp/test/CMakeLists.txt @@ -1,10 +1,10 @@ enable_testing() -file(GLOB_RECURSE BUSTUB_TEST_SOURCES "${PROJECT_SOURCE_DIR}/test/*.cpp") +file(GLOB_RECURSE MILVUS_TEST_SOURCES "${PROJECT_SOURCE_DIR}/test/*.cpp") add_executable( milvus_test - ${BUSTUB_TEST_SOURCES} + ${MILVUS_TEST_SOURCES} ) target_link_libraries( diff --git a/cpp/thirdparty/protobuf/CMakeLists.txt b/cpp/thirdparty/protobuf/CMakeLists.txt index 334d88d..b99b7b3 100644 --- a/cpp/thirdparty/protobuf/CMakeLists.txt +++ b/cpp/thirdparty/protobuf/CMakeLists.txt @@ -6,6 +6,6 @@ FetchContent_Declare(protobuf GIT_TAG v3.21.4 ) -set(protobuf_BUILD_TESTS OFF) -set(protobuf_BUILD_PROTOC_BINARIES OFF) +set(protobuf_BUILD_TESTS OFF CACHE INTERNAL "") +set(protobuf_BUILD_PROTOC_BINARIES OFF CACHE INTERNAL "") FetchContent_MakeAvailable(protobuf) \ No newline at end of file