|
| 1 | +# Copyright (c) Meta Platforms, Inc. and affiliates. |
| 2 | +# All rights reserved. |
| 3 | +# |
| 4 | +# This source code is licensed under the BSD-style license found in the |
| 5 | +# LICENSE file in the root directory of this source tree. |
| 6 | + |
| 7 | +cmake_minimum_required(VERSION 3.24) |
| 8 | +project(nemotron3_diarization_runner) |
| 9 | + |
| 10 | +set(CMAKE_CXX_STANDARD 17) |
| 11 | +set(CMAKE_CXX_STANDARD_REQUIRED ON) |
| 12 | +set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..) |
| 13 | +include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake) |
| 14 | + |
| 15 | +set(gflags_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../third-party/gflags) |
| 16 | +find_package(gflags REQUIRED) |
| 17 | +find_package(executorch CONFIG REQUIRED FIND_ROOT_PATH_BOTH) |
| 18 | +if(NOT TARGET mlxdelegate |
| 19 | + OR NOT TARGET mlx |
| 20 | + OR NOT TARGET xnnpack_backend |
| 21 | +) |
| 22 | + message( |
| 23 | + FATAL_ERROR |
| 24 | + "Build and install ExecuTorch with EXECUTORCH_BUILD_MLX=ON and EXECUTORCH_BUILD_XNNPACK=ON" |
| 25 | + ) |
| 26 | +endif() |
| 27 | +executorch_target_link_options_shared_lib(mlxdelegate) |
| 28 | +executorch_target_link_options_shared_lib(xnnpack_backend) |
| 29 | + |
| 30 | +add_library(nemotron3_diarization STATIC runner.cpp) |
| 31 | +target_include_directories(nemotron3_diarization PUBLIC ${EXECUTORCH_ROOT}/..) |
| 32 | +target_link_libraries( |
| 33 | + nemotron3_diarization |
| 34 | + PUBLIC executorch |
| 35 | + extension_module |
| 36 | + extension_data_loader |
| 37 | + extension_tensor |
| 38 | + extension_flat_tensor |
| 39 | + optimized_native_cpu_ops_lib |
| 40 | + cpublas |
| 41 | + eigen_blas |
| 42 | + xnnpack_backend |
| 43 | + XNNPACK |
| 44 | + xnnpack-microkernels-prod |
| 45 | +) |
| 46 | +if(TARGET kleidiai) |
| 47 | + target_link_libraries(nemotron3_diarization PUBLIC kleidiai) |
| 48 | +endif() |
| 49 | +executorch_target_link_options_shared_lib(optimized_native_cpu_ops_lib) |
| 50 | +add_executable(nemotron3_diarization_runner main.cpp) |
| 51 | +target_include_directories( |
| 52 | + nemotron3_diarization_runner |
| 53 | + PRIVATE ${EXECUTORCH_ROOT}/third-party/json/include |
| 54 | +) |
| 55 | +target_link_libraries( |
| 56 | + nemotron3_diarization_runner PRIVATE nemotron3_diarization gflags mlxdelegate |
| 57 | + mlx |
| 58 | +) |
| 59 | +executorch_target_copy_mlx_metallib(nemotron3_diarization_runner) |
0 commit comments