2023-03-23 17:54:14 +00:00
|
|
|
cmake_minimum_required(VERSION 3.4...3.22)
|
|
|
|
|
|
|
|
project(llama_cpp)
|
|
|
|
|
2023-07-18 22:52:29 +00:00
|
|
|
option(BUILD_LLAMA_CPP "Build llama.cpp shared library and install alongside python package" ON)
|
2023-04-25 05:36:37 +00:00
|
|
|
|
2023-07-18 22:52:29 +00:00
|
|
|
if (BUILD_LLAMA_CPP)
|
2023-04-08 06:39:17 +00:00
|
|
|
set(BUILD_SHARED_LIBS "On")
|
|
|
|
add_subdirectory(vendor/llama.cpp)
|
|
|
|
install(
|
|
|
|
TARGETS llama
|
2023-07-18 22:52:29 +00:00
|
|
|
LIBRARY DESTINATION ${SKBUILD_PLATLIB_DIR}/llama_cpp
|
|
|
|
RUNTIME DESTINATION ${SKBUILD_PLATLIB_DIR}/llama_cpp
|
|
|
|
ARCHIVE DESTINATION ${SKBUILD_PLATLIB_DIR}/llama_cpp
|
|
|
|
FRAMEWORK DESTINATION ${SKBUILD_PLATLIB_DIR}/llama_cpp
|
|
|
|
RESOURCE DESTINATION ${SKBUILD_PLATLIB_DIR}/llama_cpp
|
|
|
|
)
|
|
|
|
# Temporary fix for https://github.com/scikit-build/scikit-build-core/issues/374
|
|
|
|
install(
|
|
|
|
TARGETS llama
|
|
|
|
LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/llama_cpp
|
|
|
|
RUNTIME DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/llama_cpp
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/llama_cpp
|
|
|
|
FRAMEWORK DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/llama_cpp
|
|
|
|
RESOURCE DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/llama_cpp
|
2023-04-08 06:39:17 +00:00
|
|
|
)
|
2023-05-16 13:07:14 +00:00
|
|
|
endif()
|