diff --git a/c_api/CMakeLists.txt b/c_api/CMakeLists.txt index 01789a3214..60b9f23a68 100644 --- a/c_api/CMakeLists.txt +++ b/c_api/CMakeLists.txt @@ -30,6 +30,7 @@ set(FAISS_C_SRC index_io_c.cpp impl/AuxIndexStructures_c.cpp utils/distances_c.cpp + utils/utils_c.cpp ) add_library(faiss_c ${FAISS_C_SRC}) target_link_libraries(faiss_c PRIVATE faiss) diff --git a/c_api/utils/utils_c.cpp b/c_api/utils/utils_c.cpp new file mode 100644 index 0000000000..bca2ad8688 --- /dev/null +++ b/c_api/utils/utils_c.cpp @@ -0,0 +1,16 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// Copyright 2004-present Facebook. All Rights Reserved. +// -*- c++ -*- + +#include "utils_c.h" +#include + +const char* faiss_get_version() { + return VERSION_STRING; +} diff --git a/c_api/utils/utils_c.h b/c_api/utils/utils_c.h new file mode 100644 index 0000000000..07cf4338ff --- /dev/null +++ b/c_api/utils/utils_c.h @@ -0,0 +1,27 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// Copyright 2004-present Facebook. All Rights Reserved. +// -*- c -*- + +#ifndef FAISS_UTILS_C_H +#define FAISS_UTILS_C_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +const char* faiss_get_version(); + +#ifdef __cplusplus +} +#endif + +#endif