CMakeLists.txt 637 B

123456789101112131415161718192021222324252627282930313233343536
  1. # dependencies
  2. find_package(Threads REQUIRED)
  3. # third-party
  4. # ...
  5. # common
  6. set(TARGET common)
  7. add_library(${TARGET} OBJECT
  8. common.h
  9. common.cpp
  10. )
  11. if (BUILD_SHARED_LIBS)
  12. set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
  13. endif()
  14. target_include_directories(${TARGET} PUBLIC .)
  15. target_compile_features(${TARGET} PUBLIC cxx_std_11)
  16. target_link_libraries(${TARGET} PRIVATE llama)
  17. # examples
  18. include_directories(${CMAKE_CURRENT_SOURCE_DIR})
  19. if (EMSCRIPTEN)
  20. else()
  21. add_subdirectory(main)
  22. add_subdirectory(quantize)
  23. add_subdirectory(perplexity)
  24. add_subdirectory(embedding)
  25. endif()