CMakeLists.txt 749 B

123456789101112131415161718192021222324252627282930313233
  1. # TODO: should not use this
  2. if (WIN32)
  3. if (BUILD_SHARED_LIBS)
  4. set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
  5. endif()
  6. endif()
  7. #
  8. # libraries
  9. #
  10. # llama
  11. add_library(llama
  12. ../include/llama.h
  13. llama.cpp
  14. llama-vocab.cpp
  15. llama-grammar.cpp
  16. llama-sampling.cpp
  17. unicode.h
  18. unicode.cpp
  19. unicode-data.cpp
  20. )
  21. target_include_directories(llama PUBLIC . ../include)
  22. target_compile_features (llama PUBLIC cxx_std_11) # don't bump
  23. target_link_libraries(llama PUBLIC ggml)
  24. if (BUILD_SHARED_LIBS)
  25. set_target_properties(llama PROPERTIES POSITION_INDEPENDENT_CODE ON)
  26. target_compile_definitions(llama PRIVATE LLAMA_SHARED LLAMA_BUILD)
  27. endif()