# 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.

get_built_tool_path(
  TOOL_enum_parser_bin
  TOOL_enum_parser_dependency
  tools/enum_parser/enum_parser
  enum_parser
)

add_subdirectory(flatbuffers)
add_subdirectory(model_export)
add_subdirectory(ut)

add_library(catboost-libs-model)


target_link_libraries(catboost-libs-model PUBLIC
  contrib-libs-linux-headers
  contrib-libs-cxxsupp
  yutil
  catboost-libs-cat_feature
  private-libs-ctr_description
  private-libs-embedding_features
  private-libs-options
  private-libs-text_features
  catboost-libs-helpers
  catboost-libs-logging
  libs-model-flatbuffers
  contrib-libs-flatbuffers
  library-cpp-binsaver
  cpp-containers-dense_hash
  library-cpp-dbg_output
  library-cpp-json
  library-cpp-object_factory
  tools-enum_parser-enum_serialization_runtime
)

target_sources(catboost-libs-model PRIVATE
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/cpu/evaluator_impl.cpp
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/cpu/quantization.cpp
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/ctr_data.cpp
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/ctr_helpers.cpp
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/ctr_provider.cpp
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/ctr_value_table.cpp
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/eval_processing.cpp
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/evaluation_interface.cpp
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/features.cpp
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/model.cpp
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/model_build_helper.cpp
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/model_estimated_features.cpp
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/online_ctr.cpp
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/scale_and_bias.cpp
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/static_ctr_provider.cpp
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/utils.cpp
)


generate_enum_serilization(catboost-libs-model
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/ctr_provider.h
  INCLUDE_HEADERS
  catboost/libs/model/ctr_provider.h
)

generate_enum_serilization(catboost-libs-model
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/enums.h
  INCLUDE_HEADERS
  catboost/libs/model/enums.h
)

generate_enum_serilization(catboost-libs-model
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/features.h
  INCLUDE_HEADERS
  catboost/libs/model/features.h
)

generate_enum_serilization(catboost-libs-model
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/split.h
  INCLUDE_HEADERS
  catboost/libs/model/split.h
)

add_global_library_for(catboost-libs-model.global
  catboost-libs-model)


target_link_libraries(catboost-libs-model.global PUBLIC
  contrib-libs-linux-headers
  contrib-libs-cxxsupp
  yutil
  catboost-libs-cat_feature
  private-libs-ctr_description
  private-libs-embedding_features
  private-libs-options
  private-libs-text_features
  catboost-libs-helpers
  catboost-libs-logging
  libs-model-flatbuffers
  contrib-libs-flatbuffers
  library-cpp-binsaver
  cpp-containers-dense_hash
  library-cpp-dbg_output
  library-cpp-json
  library-cpp-object_factory
  tools-enum_parser-enum_serialization_runtime
)

target_sources(catboost-libs-model.global PRIVATE
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/cpu/formula_evaluator.cpp
  ${PROJECT_SOURCE_DIR}/catboost/libs/model/model_import_interface.cpp
)

