File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
examples/llama.android/llama/src/main/cpp Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ set(${TARGET}_HEADERS
6060 speculative.h
6161)
6262
63- list (TRANSFORM ${TARGET} _HEADERS PREPEND ${CMAKE_SOURCE_DIR} /common /)
63+ list (TRANSFORM ${TARGET} _HEADERS PREPEND ${CMAKE_CURRENT_SOURCE_DIR} /)
6464
6565add_library (${TARGET} STATIC
6666 arg.cpp
Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ project("llama-android")
2121# Also provides "common"
2222#FetchContent_MakeAvailable(llama)
2323
24+ set (LLAMA_ROOT_DIR "../../../../../.." )
25+
26+ # Set global include directories that will be used by all targets
27+ include_directories (${LLAMA_ROOT_DIR} /include )
28+ include_directories (${LLAMA_ROOT_DIR} /vendor)
29+
2430# Creates and names a library, sets it as either STATIC
2531# or SHARED, and provides the relative paths to its source code.
2632# You can define multiple libraries, and CMake builds them for you.
@@ -32,7 +38,7 @@ project("llama-android")
3238#
3339
3440#load local llama.cpp
35- add_subdirectory (../../../../../.. / build -llama)
41+ add_subdirectory (${LLAMA_ROOT_DIR} / build -llama)
3642
3743# In order to load a library into your app from Java/Kotlin, you must call
3844# System.loadLibrary() and pass the name of the library defined here;
@@ -51,3 +57,9 @@ target_link_libraries(${CMAKE_PROJECT_NAME}
5157 common
5258 android
5359 log )
60+
61+ # Add include directories for llama.h and common.h
62+ target_include_directories (${CMAKE_PROJECT_NAME} PRIVATE
63+ ${LLAMA_ROOT_DIR} /include
64+ ${LLAMA_ROOT_DIR} /src
65+ ${LLAMA_ROOT_DIR} /common)
You can’t perform that action at this time.
0 commit comments