File tree Expand file tree Collapse file tree 1 file changed +23
-9
lines changed Expand file tree Collapse file tree 1 file changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,26 @@ cmake_minimum_required(VERSION 3.4...3.22)
2
2
3
3
project (llama_cpp )
4
4
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 )
You can’t perform that action at this time.
0 commit comments