-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
90 lines (69 loc) · 2.02 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Copyright (c) Alpaca Core
# SPDX-License-Identifier: MIT
#
cmake_minimum_required(VERSION 3.24 FATAL_ERROR)
project(ilib-whisper.cpp
VERSION 1.0.0
DESCRIPTION "Example plugin for the Alpaca Core Local SDK"
LANGUAGES CXX
)
include(./get-ac-build.cmake)
#################
# cmake lib
CPMAddPackage(gh:iboB/[email protected])
list(APPEND CMAKE_MODULE_PATH
"${icm_SOURCE_DIR}"
)
include(icm_add_lib)
include(init_ac_prj)
include(ac_build_prj_util)
include(ac_build_plugin_util)
#################
# options
option(AC_WHISPER_BUILD_TESTS "${PROJECT_NAME}: build tests" ${testsDefault})
option(AC_WHISPER_BUILD_EXAMPLES "${PROJECT_NAME}: build examples" ${examplesDefault})
mark_as_advanced(AC_WHISPER_BUILD_TESTS AC_WHISPER_BUILD_EXAMPLES)
init_ac_plugin_option(WHISPER)
#######################################
# packages
add_ac_local(0.1.3)
CPMAddPackage(gh:iboB/[email protected])
CPMAddPackage(gh:iboB/[email protected])
#######################################
# submodule and config
find_package(CUDAToolkit)
if(CUDAToolkit_FOUND)
set(haveCuda YES)
enable_language(CUDA)
set(CMAKE_CUDA_ARCHITECTURES 70)
message(STATUS "${CMAKE_PROJECT_NAME}: system CUDA found")
# we should add -forward-unknown-to-host-compiler but it somehow works without it
# could it be that it depends on the CMake version?
endif()
if(haveCuda)
set(GGML_CUDA ON)
endif()
set(GGML_CCACHE OFF)
add_subdirectory(whisper.cpp)
#######################################
# subdirs
add_subdirectory(code)
if(AC_WHISPER_BUILD_TESTS OR AC_WHISPER_BUILD_EXAMPLES)
CPMAddPackage(
NAME ac-test-data-whisper
VERSION 1.0.0
GIT_REPOSITORY https://huggingface.co/alpaca-core/ac-test-data-whisper
GIT_TAG f33d981742198f2b55494265fc9d43156b39a30d
)
CPMAddPackage(gh:alpaca-core/[email protected])
endif()
if(AC_WHISPER_BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif()
if(AC_WHISPER_BUILD_EXAMPLES)
add_subdirectory(example)
endif()
if(BUILD_AC_WHISPER_PLUGIN)
add_subdirectory(ac-local-plugin)
endif()