mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Remove duplicated thirdparty (#12925)
Signed-off-by: yudong.cai <yudong.cai@zilliz.com>
This commit is contained in:
parent
2c42abf23b
commit
7b97b155e8
@ -14,10 +14,10 @@ if(NOT DEFINED FIU_VERSION)
|
||||
set(FIU_VERSION 1.00)
|
||||
endif()
|
||||
|
||||
if ( DEFINED ENV{Knowhere_FIU_URL} )
|
||||
if ( DEFINED ENV{KNOWHERE_FIU_URL} )
|
||||
set( FIU_SOURCE_URL "$ENV{MILVUS_FIU_URL}" )
|
||||
else ()
|
||||
set( FIU_SOURCE_URL "https://github.com.cnpmjs.org/albertito/libfiu/archive/${FIU_VERSION}.tar.gz" )
|
||||
set( FIU_SOURCE_URL "https://github.com/albertito/libfiu/archive/${FIU_VERSION}.tar.gz" )
|
||||
endif ()
|
||||
|
||||
macro( build_fiu )
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
FetchContent_Declare(google_benchmark
|
||||
URL https://github.com/google/benchmark/archive/v1.5.2.tar.gz
|
||||
URL_MD5 084b34aceaeac11a6607d35220ca2efa
|
||||
DOWNLOAD_DIR ${THIRDPARTY_DOWNLOAD_PATH}
|
||||
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/google_benchmark
|
||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/google_benchmark
|
||||
)
|
||||
|
||||
FetchContent_GetProperties( google_benchmark )
|
||||
if ( NOT google_benchmark_POPULATED )
|
||||
|
||||
FetchContent_Populate( google_benchmark )
|
||||
|
||||
# Adding the following targets:
|
||||
# gtest, gtest_main, gmock, gmock_main
|
||||
message("gb=${google_benchmark_SOURCE_DIR}")
|
||||
add_subdirectory( ${google_benchmark_SOURCE_DIR}
|
||||
${google_benchmark_BINARY_DIR}
|
||||
EXCLUDE_FROM_ALL )
|
||||
endif()
|
||||
@ -1,66 +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.
|
||||
#-------------------------------------------------------------------------------
|
||||
set( GTEST_VERSION 1.8.1 )
|
||||
|
||||
if ( DEFINED ENV{MILVUS_GTEST_URL} )
|
||||
set( GTEST_SOURCE_URL "$ENV{MILVUS_GTEST_URL}" )
|
||||
else()
|
||||
set( GTEST_SOURCE_URL "https://github.com/google/googletest/archive/release-${GTEST_VERSION}.zip" )
|
||||
endif()
|
||||
|
||||
message( STATUS "Building gtest-${GTEST_VERSION} from source" )
|
||||
|
||||
set( CMAKE_POLICY_DEFAULT_CMP0022 NEW ) # for googletest only
|
||||
|
||||
FetchContent_Declare(
|
||||
googletest
|
||||
URL ${GTEST_SOURCE_URL}
|
||||
URL_MD5 "ad6868782b5952b7476a7c1c72d5a714"
|
||||
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest-src
|
||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest-build
|
||||
DOWNLOAD_DIR ${THIRDPARTY_DOWNLOAD_PATH} )
|
||||
|
||||
FetchContent_GetProperties( googletest )
|
||||
if ( NOT googletest_POPULATED )
|
||||
|
||||
FetchContent_Populate( googletest )
|
||||
|
||||
# Adding the following targets:
|
||||
# gtest, gtest_main, gmock, gmock_main
|
||||
add_subdirectory( ${googletest_SOURCE_DIR}
|
||||
${googletest_BINARY_DIR}
|
||||
EXCLUDE_FROM_ALL )
|
||||
endif()
|
||||
# include(GoogleTest)
|
||||
|
||||
# ****************************************************************
|
||||
# Create ALIAS Target
|
||||
# ****************************************************************
|
||||
# if (NOT TARGET GTest:gtest)
|
||||
# add_library( GTest::gtest ALIAS gtest )
|
||||
# endif()
|
||||
# if (NOT TARGET GTest:main)
|
||||
# add_library( GTest::main ALIAS gtest_main )
|
||||
# endif()
|
||||
# if (NOT TARGET GMock:gmock)
|
||||
# target_link_libraries( gmock INTERFACE GTest::gtest )
|
||||
# add_library( GMock::gmock ALIAS gmock )
|
||||
# endif()
|
||||
# if (NOT TARGET GMock:main)
|
||||
# target_link_libraries( gmock_main INTERFACE GTest::gtest )
|
||||
# add_library( GMock::main ALIAS gmock_main )
|
||||
# endif()
|
||||
|
||||
|
||||
get_property( var DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/googletest-src" PROPERTY COMPILE_OPTIONS )
|
||||
message( STATUS "gtest compile options: ${var}" )
|
||||
1
internal/core/thirdparty/CMakeLists.txt
vendored
1
internal/core/thirdparty/CMakeLists.txt
vendored
@ -54,5 +54,4 @@ if ( MILVUS_WITH_OPENTRACING )
|
||||
endif()
|
||||
|
||||
add_subdirectory( protobuf )
|
||||
add_subdirectory( fiu )
|
||||
add_subdirectory( boost_ext )
|
||||
|
||||
61
internal/core/thirdparty/fiu/CMakeLists.txt
vendored
61
internal/core/thirdparty/fiu/CMakeLists.txt
vendored
@ -1,61 +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.
|
||||
#-------------------------------------------------------------------------------
|
||||
if(NOT DEFINED FIU_VERSION)
|
||||
set(FIU_VERSION 1.00)
|
||||
endif()
|
||||
|
||||
if ( DEFINED ENV{MILVUS_FIU_URL} )
|
||||
set( FIU_SOURCE_URL "$ENV{MILVUS_FIU_URL}" )
|
||||
else ()
|
||||
set( FIU_SOURCE_URL "https://github.com/albertito/libfiu/archive/${FIU_VERSION}.tar.gz" )
|
||||
endif ()
|
||||
|
||||
macro( build_fiu )
|
||||
message( STATUS "Building FIU-${FIU_VERSION} from source" )
|
||||
ExternalProject_Add(
|
||||
fiu_ep
|
||||
PREFIX ${CMAKE_BINARY_DIR}/3rdparty_download/fiu-subbuild
|
||||
DOWNLOAD_DIR ${THIRDPARTY_DOWNLOAD_PATH}
|
||||
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}
|
||||
URL ${FIU_SOURCE_URL}
|
||||
URL_MD5 "75f9d076daf964c9410611701f07c61b"
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_IN_SOURCE 1
|
||||
BUILD_COMMAND ${MAKE}
|
||||
INSTALL_COMMAND ${MAKE} "PREFIX=<INSTALL_DIR>" install
|
||||
${EP_LOG_OPTIONS}
|
||||
)
|
||||
|
||||
ExternalProject_Get_Property( fiu_ep INSTALL_DIR )
|
||||
if( NOT IS_DIRECTORY ${INSTALL_DIR}/include )
|
||||
file( MAKE_DIRECTORY "${INSTALL_DIR}/include" )
|
||||
endif()
|
||||
add_library( fiu SHARED IMPORTED )
|
||||
set_target_properties( fiu
|
||||
PROPERTIES
|
||||
IMPORTED_GLOBAL TRUE
|
||||
IMPORTED_LOCATION ${INSTALL_DIR}/lib/libfiu.so
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include )
|
||||
add_dependencies(fiu fiu_ep)
|
||||
endmacro()
|
||||
|
||||
build_fiu()
|
||||
|
||||
install( FILES ${INSTALL_DIR}/lib/libfiu.so
|
||||
${INSTALL_DIR}/lib/libfiu.so.0
|
||||
${INSTALL_DIR}/lib/libfiu.so.1.00
|
||||
DESTINATION lib )
|
||||
|
||||
get_target_property( var fiu INTERFACE_INCLUDE_DIRECTORIES )
|
||||
message( STATUS ${var} )
|
||||
set_directory_properties( PROPERTY INCLUDE_DIRECTORIES ${var} )
|
||||
37
internal/core/thirdparty/fiu/fiu-local.h
vendored
37
internal/core/thirdparty/fiu/fiu-local.h
vendored
@ -1,37 +0,0 @@
|
||||
|
||||
/* libfiu - Fault Injection in Userspace
|
||||
*
|
||||
* This header, part of libfiu, is meant to be included in your project to
|
||||
* avoid having libfiu as a mandatory build-time dependency.
|
||||
*
|
||||
* You can add it to your project, and #include it instead of fiu.h.
|
||||
* The real fiu.h will be used only when FIU_ENABLE is defined.
|
||||
*
|
||||
* This header, as the rest of libfiu, is in the public domain.
|
||||
*
|
||||
* You can find more information about libfiu at
|
||||
* http://blitiri.com.ar/p/libfiu.
|
||||
*/
|
||||
|
||||
#ifndef _FIU_LOCAL_H
|
||||
#define _FIU_LOCAL_H
|
||||
|
||||
/* Only define the stubs when fiu is disabled, otherwise use the real fiu.h
|
||||
* header */
|
||||
#ifndef FIU_ENABLE
|
||||
|
||||
#define fiu_init(flags) 0
|
||||
#define fiu_fail(name) 0
|
||||
#define fiu_failinfo() NULL
|
||||
#define fiu_do_on(name, action)
|
||||
#define fiu_exit_on(name)
|
||||
#define fiu_return_on(name, retval)
|
||||
|
||||
#else
|
||||
|
||||
#include <fiu.h>
|
||||
|
||||
#endif /* FIU_ENABLE */
|
||||
|
||||
#endif /* _FIU_LOCAL_H */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user