2022-10-22 12:07:59 +02:00
|
|
|
# dependencies
|
|
|
|
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
|
|
|
# third-party
|
|
|
|
|
2023-04-30 11:14:33 +02:00
|
|
|
if (WHISPER_SDL2)
|
2022-10-25 18:13:08 +02:00
|
|
|
# SDL2
|
|
|
|
find_package(SDL2 REQUIRED)
|
|
|
|
|
|
|
|
string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES)
|
|
|
|
|
|
|
|
message(STATUS "SDL2_INCLUDE_DIRS = ${SDL2_INCLUDE_DIRS}")
|
|
|
|
message(STATUS "SDL2_LIBRARIES = ${SDL2_LIBRARIES}")
|
|
|
|
endif()
|
2022-10-22 12:07:59 +02:00
|
|
|
|
2023-02-15 18:28:10 +01:00
|
|
|
# common
|
|
|
|
|
|
|
|
set(TARGET common)
|
|
|
|
|
|
|
|
add_library(${TARGET} STATIC
|
|
|
|
common.h
|
|
|
|
common.cpp
|
2023-04-30 17:51:57 +02:00
|
|
|
common-ggml.h
|
|
|
|
common-ggml.cpp
|
2023-02-15 18:28:10 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
include(DefaultTargetOptions)
|
|
|
|
|
2023-04-30 17:51:57 +02:00
|
|
|
target_link_libraries(${TARGET} PRIVATE whisper)
|
|
|
|
|
2023-02-15 18:28:10 +01:00
|
|
|
set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
|
|
|
2023-04-30 11:14:33 +02:00
|
|
|
if (WHISPER_SDL2)
|
2023-02-15 18:28:10 +01:00
|
|
|
# common-sdl
|
|
|
|
|
|
|
|
set(TARGET common-sdl)
|
|
|
|
|
|
|
|
add_library(${TARGET} STATIC
|
|
|
|
common-sdl.h
|
|
|
|
common-sdl.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
include(DefaultTargetOptions)
|
|
|
|
|
|
|
|
target_include_directories(${TARGET} PUBLIC ${SDL2_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(${TARGET} PRIVATE ${SDL2_LIBRARIES})
|
|
|
|
|
|
|
|
set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
|
|
endif()
|
|
|
|
|
2022-10-22 12:07:59 +02:00
|
|
|
# examples
|
|
|
|
|
2022-10-25 18:13:08 +02:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
2022-10-22 12:07:59 +02:00
|
|
|
if (EMSCRIPTEN)
|
|
|
|
add_subdirectory(whisper.wasm)
|
2022-11-25 22:57:46 +01:00
|
|
|
add_subdirectory(stream.wasm)
|
2022-11-26 10:40:06 +01:00
|
|
|
add_subdirectory(command.wasm)
|
2022-11-21 21:20:42 +01:00
|
|
|
add_subdirectory(talk.wasm)
|
2022-12-11 10:09:01 +01:00
|
|
|
add_subdirectory(bench.wasm)
|
2023-02-04 08:10:25 +01:00
|
|
|
elseif(CMAKE_JS_VERSION)
|
|
|
|
add_subdirectory(addon.node)
|
2022-10-22 12:07:59 +02:00
|
|
|
else()
|
2022-10-25 18:13:08 +02:00
|
|
|
add_subdirectory(main)
|
|
|
|
add_subdirectory(stream)
|
2022-11-25 18:06:56 +01:00
|
|
|
add_subdirectory(command)
|
2022-10-25 18:13:08 +02:00
|
|
|
add_subdirectory(bench)
|
2023-04-30 17:51:57 +02:00
|
|
|
add_subdirectory(quantize)
|
2022-12-09 19:38:10 +01:00
|
|
|
add_subdirectory(talk)
|
2023-03-27 20:00:32 +02:00
|
|
|
add_subdirectory(talk-llama)
|
2022-10-22 12:07:59 +02:00
|
|
|
endif()
|