Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e611cfc

Browse filesBrowse files
committed
Build shared library with make on unix platforms
1 parent a3f7130 commit e611cfc
Copy full SHA for e611cfc

File tree

Expand file treeCollapse file tree

1 file changed

+23
-9
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+23
-9
lines changed

‎CMakeLists.txt

Copy file name to clipboardExpand all lines: CMakeLists.txt
+23-9Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,26 @@ cmake_minimum_required(VERSION 3.4...3.22)
22

33
project(llama_cpp)
44

5-
set(BUILD_SHARED_LIBS "On")
6-
7-
add_subdirectory(vendor/llama.cpp)
8-
9-
install(
10-
TARGETS llama
11-
LIBRARY DESTINATION llama_cpp
12-
RUNTIME DESTINATION llama_cpp
13-
)
5+
if (UNIX)
6+
add_custom_command(
7+
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/vendor/llama.cpp/libllama.so
8+
COMMAND make libllama.so
9+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/vendor/llama.cpp
10+
)
11+
add_custom_target(
12+
run ALL
13+
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/vendor/llama.cpp/libllama.so
14+
)
15+
install(
16+
FILES ${CMAKE_CURRENT_SOURCE_DIR}/vendor/llama.cpp/libllama.so
17+
DESTINATION llama_cpp
18+
)
19+
else()
20+
set(BUILD_SHARED_LIBS "On")
21+
add_subdirectory(vendor/llama.cpp)
22+
install(
23+
TARGETS llama
24+
LIBRARY DESTINATION llama_cpp
25+
RUNTIME DESTINATION llama_cpp
26+
)
27+
endif(UNIX)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.