Skip to content

Commit 529b72d

Browse files
committed
[vcpkg-ci-llama-cpp] New test port
1 parent 033679c commit 529b72d

File tree

4 files changed

+63
-0
lines changed

4 files changed

+63
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
2+
3+
vcpkg_find_acquire_program(PKGCONFIG)
4+
set(ENV{PKG_CONFIG} "${PKGCONFIG}")
5+
6+
vcpkg_cmake_configure(
7+
SOURCE_PATH "${CURRENT_PORT_DIR}/project"
8+
)
9+
vcpkg_cmake_build()
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
project(whisper-cpp-test)
3+
4+
find_package(whisper CONFIG REQUIRED)
5+
6+
add_executable(test-cmake main.cxx)
7+
add_library(imported::whisper ALIAS whisper)
8+
target_link_libraries(test-cmake PRIVATE imported::whisper)
9+
10+
find_package(PkgConfig REQUIRED)
11+
pkg_check_modules(whisper-cpp whisper REQUIRED IMPORTED_TARGET)
12+
13+
add_executable(test-pkconfig main.cxx)
14+
target_link_libraries(test-pkconfig PRIVATE PkgConfig::whisper-cpp)
15+
16+
# Vulkan on Android isn't really useful, but the build can succeed.
17+
if(ANDROID AND TARGET ggml::ggml-vulkan)
18+
# Instantiates VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
19+
find_package(Vulkan REQUIRED)
20+
target_link_libraries(test-cmake PRIVATE Vulkan::Vulkan)
21+
target_compile_definitions(test-cmake PRIVATE VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
22+
target_link_libraries(test-pkconfig PRIVATE Vulkan::Vulkan)
23+
target_compile_definitions(test-pkconfig PRIVATE VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
24+
endif()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <llama.h>
2+
3+
#if defined(VULKAN_HPP_DISPATCH_LOADER_DYNAMIC) && VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
4+
#include <vulkan/vulkan.hpp>
5+
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
6+
#endif
7+
8+
int main()
9+
{
10+
auto context_params = llama_context_default_params();
11+
ggml_backend_load_all();
12+
return 0;
13+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "vcpkg-ci-llama-cpp",
3+
"version-string": "ci",
4+
"description": "Port to validate llama-cpp",
5+
"homepage": "https://github.com/microsoft/vcpkg",
6+
"license": "MIT",
7+
"dependencies": [
8+
{
9+
"name": "llama-cpp",
10+
"default-features": false
11+
},
12+
{
13+
"name": "vcpkg-cmake",
14+
"host": true
15+
}
16+
]
17+
}

0 commit comments

Comments
 (0)