diff --git a/internal/core/src/common/CMakeLists.txt b/internal/core/src/common/CMakeLists.txt index 0c2c0391a9..659b45b047 100644 --- a/internal/core/src/common/CMakeLists.txt +++ b/internal/core/src/common/CMakeLists.txt @@ -20,6 +20,6 @@ add_library(milvus_common SHARED ${COMMON_SRC} ) -target_link_libraries(milvus_common milvus_utils milvus_config log knowhere milvus_proto yaml-cpp ) +target_link_libraries(milvus_common milvus_utils milvus_config milvus_log knowhere milvus_proto yaml-cpp ) install(TARGETS milvus_common DESTINATION lib) diff --git a/internal/core/src/config/CMakeLists.txt b/internal/core/src/config/CMakeLists.txt index 8b6169aa8b..08ed267216 100644 --- a/internal/core/src/config/CMakeLists.txt +++ b/internal/core/src/config/CMakeLists.txt @@ -18,9 +18,8 @@ set(CONFIG_SRC ConfigKnowhere.cpp ) -add_library(milvus_config - ${CONFIG_SRC} - ) +add_library(milvus_config STATIC ${CONFIG_SRC}) + target_link_libraries(milvus_config knowhere milvus_proto diff --git a/internal/core/src/exceptions/CMakeLists.txt b/internal/core/src/exceptions/CMakeLists.txt index 78be5ba8f5..5daeb4bb22 100644 --- a/internal/core/src/exceptions/CMakeLists.txt +++ b/internal/core/src/exceptions/CMakeLists.txt @@ -18,5 +18,6 @@ set(exceptions_files EasyAssert.cpp ) -add_library(milvus_exceptions ${exceptions_files}) +add_library(milvus_exceptions STATIC ${exceptions_files}) + target_link_libraries(milvus_exceptions PRIVATE milvus_proto) diff --git a/internal/core/src/exceptions/EasyAssert.cpp b/internal/core/src/exceptions/EasyAssert.cpp index 2ae1b19ba3..bba64dd456 100644 --- a/internal/core/src/exceptions/EasyAssert.cpp +++ b/internal/core/src/exceptions/EasyAssert.cpp @@ -54,13 +54,4 @@ EasyAssertInfo(bool value, } } -[[noreturn]] void -ThrowWithTrace(const std::exception& exception) { - if (typeid(exception) == typeid(SegcoreError)) { - throw exception; - } - auto err_msg = exception.what() + std::string("\n") + EasyStackTrace(); - throw SegcoreError(ErrorCodeEnum::UnexpectedError, err_msg); -} - } // namespace milvus::impl diff --git a/internal/core/src/exceptions/EasyAssert.h b/internal/core/src/exceptions/EasyAssert.h index 7c8c47c7fb..b79a8172b0 100644 --- a/internal/core/src/exceptions/EasyAssert.h +++ b/internal/core/src/exceptions/EasyAssert.h @@ -35,9 +35,6 @@ EasyAssertInfo(bool value, std::string_view extra_info, ErrorCodeEnum error_code = ErrorCodeEnum::UnexpectedError); -[[noreturn]] void -ThrowWithTrace(const std::exception& exception); - } // namespace impl class SegcoreError : public std::runtime_error { diff --git a/internal/core/src/log/CMakeLists.txt b/internal/core/src/log/CMakeLists.txt index 98577f3442..518a56e27e 100644 --- a/internal/core/src/log/CMakeLists.txt +++ b/internal/core/src/log/CMakeLists.txt @@ -16,6 +16,6 @@ set(LOG_FILES ${MILVUS_ENGINE_SRC}/log/Log.cpp ${MILVUS_THIRDPARTY_SRC}/easyloggingpp/easylogging++.h ) -add_library(log STATIC ${LOG_FILES}) -set_target_properties(log PROPERTIES RULE_LAUNCH_COMPILE "") -set_target_properties(log PROPERTIES RULE_LAUNCH_LINK "") +add_library(milvus_log STATIC ${LOG_FILES}) +set_target_properties(milvus_log PROPERTIES RULE_LAUNCH_COMPILE "") +set_target_properties(milvus_log PROPERTIES RULE_LAUNCH_LINK "") diff --git a/internal/core/src/utils/Types.cpp b/internal/core/src/utils/Types.cpp deleted file mode 100644 index ab50d1ec72..0000000000 --- a/internal/core/src/utils/Types.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License - -#include "Types.h" diff --git a/internal/core/src/utils/Types.h b/internal/core/src/utils/Types.h index 4dff86801e..2a856507f1 100644 --- a/internal/core/src/utils/Types.h +++ b/internal/core/src/utils/Types.h @@ -11,8 +11,6 @@ #pragma once -// #include - #include #include #include diff --git a/internal/core/unittest/CMakeLists.txt b/internal/core/unittest/CMakeLists.txt index a14e992885..da6accce37 100644 --- a/internal/core/unittest/CMakeLists.txt +++ b/internal/core/unittest/CMakeLists.txt @@ -62,7 +62,7 @@ if (LINUX) milvus_segcore milvus_indexbuilder milvus_index - log + milvus_log pthread ) install(TARGETS index_builder_test DESTINATION unittest) @@ -93,7 +93,7 @@ target_link_libraries(all_tests milvus_segcore milvus_indexbuilder milvus_index - log + milvus_log pthread ) diff --git a/internal/core/unittest/bench/CMakeLists.txt b/internal/core/unittest/bench/CMakeLists.txt index adbb916d13..defdc125a2 100644 --- a/internal/core/unittest/bench/CMakeLists.txt +++ b/internal/core/unittest/bench/CMakeLists.txt @@ -24,7 +24,7 @@ set(indexbuilder_bench_srcs add_executable(all_bench ${bench_srcs}) target_link_libraries(all_bench milvus_segcore - log + milvus_log pthread ) @@ -35,7 +35,7 @@ target_link_libraries(indexbuilder_bench milvus_segcore milvus_indexbuilder milvus_index - log + milvus_log pthread knowhere milvus_utils