# This file was generated by the YaTool build system (https://github.com/yandex/yatool),
# from a source YaTool build configuration provided in ya.make files.
#
# If the repository supports both CMake and ya build configurations, please modify both of them.
#
# If only CMake build configuration is supported then modify only CMake files and note that only
# simple modifications are allowed like adding source-files to targets or adding simple properties
# like target_include_directories. These modifications will be ported to original ya.make files
# by maintainers. Any complex modifications which can't be easily ported back to the ya build
# system may be rejected.
#
# Please refer to the build instructions in the repository for more information about manual
# changes in this file.

find_package(Python3 REQUIRED COMPONENTS
  Development
)

add_shared_library(_hnsw)


target_compile_options(_hnsw PRIVATE
  $<IF:$<CXX_COMPILER_ID:MSVC>,,-Wno-everything>
)

target_link_libraries(_hnsw PUBLIC
  contrib-libs-linux-headers
  contrib-libs-cxxsupp
  yutil
  Python3::Module
  python-numpy-include
  cpp-hnsw-helpers
  cpp-hnsw-index
  cpp-hnsw-index_builder
  cpp-hnsw-logging
  cpp-online_hnsw-base
  cpp-online_hnsw-dense_vectors
  library-cpp-pair_vector_distance
)

target_link_options(_hnsw PRIVATE
  -ldl
  -lrt
  -Wl,--no-as-needed
  -fPIC
  -Wl,-z,notext
  -Wl,-Bsymbolic
  -fPIC
  -lpthread
  -lrt
  -ldl
)

target_cython_sources(_hnsw PRIVATE
  ${PROJECT_SOURCE_DIR}/library/python/hnsw/hnsw/_hnsw.pyx
)

target_sources(_hnsw PRIVATE
  ${PROJECT_SOURCE_DIR}/library/python/hnsw/hnsw/helpers.cpp
)


use_export_script(_hnsw
  ${PROJECT_SOURCE_DIR}/library/python/hnsw/hnsw/hnsw3.exports
)

target_cython_options(_hnsw
  -E
  UNAME_SYSNAME=Linux
  --module-name
  _hnsw
  --cplus
)

target_cython_include_directories(_hnsw
  ${PROJECT_BINARY_DIR}
  ${PROJECT_SOURCE_DIR}
  ${PROJECT_SOURCE_DIR}/contrib/tools/cython/Cython/Includes
  ${PROJECT_SOURCE_DIR}/contrib/python/numpy/include/numpy/core/include
  ${PROJECT_SOURCE_DIR}/contrib/python/numpy/include/numpy/core/include/numpy
)

set_python_type_for_cython(_hnsw
  PY3
)

vcs_info(_hnsw)
