CMakeLists.txt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. llama_add_compile_flags()
  2. #
  3. # libraries
  4. #
  5. # llama
  6. add_library(llama
  7. ../include/llama.h
  8. llama.cpp
  9. llama-adapter.cpp
  10. llama-arch.cpp
  11. llama-batch.cpp
  12. llama-chat.cpp
  13. llama-context.cpp
  14. llama-grammar.cpp
  15. llama-graph.cpp
  16. llama-hparams.cpp
  17. llama-impl.cpp
  18. llama-io.cpp
  19. llama-kv-cache.cpp
  20. llama-memory.cpp
  21. llama-mmap.cpp
  22. llama-model-loader.cpp
  23. llama-model.cpp
  24. llama-quant.cpp
  25. llama-sampling.cpp
  26. llama-vocab.cpp
  27. unicode-data.cpp
  28. unicode.cpp
  29. unicode.h
  30. )
  31. target_include_directories(llama PUBLIC . ../include)
  32. target_compile_features (llama PUBLIC cxx_std_17) # don't bump
  33. target_link_libraries(llama PUBLIC ggml)
  34. if (BUILD_SHARED_LIBS)
  35. set_target_properties(llama PROPERTIES POSITION_INDEPENDENT_CODE ON)
  36. target_compile_definitions(llama PRIVATE LLAMA_BUILD)
  37. target_compile_definitions(llama PUBLIC LLAMA_SHARED)
  38. endif()