Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pkg-config and cmake --install #161

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -22,6 +22,7 @@ models/*
/result
/perplexity
/embedding
/rwkv.pc

arm_neon.h
compile_commands.json
Expand Down
14 changes: 14 additions & 0 deletions CMakeLists.txt
Expand Up @@ -452,3 +452,17 @@ if (NOT RWKV_STANDALONE)
elseif()
set_property(TARGET ggml PROPERTY GGML_STANDALONE ON)
endif()

if (RWKV_BUILD_SHARED_LIBRARY)
install(TARGETS rwkv LIBRARY)
endif()

if (RWKV_STATIC)
install(TARGETS rwkv ARCHIVE)
endif()

if (RWKV_BUILD_SHARED_LIBRARY OR RWKV_STATIC)
configure_file(rwkv.pc.in rwkv.pc @ONLY)
install(FILES rwkv.pc DESTINATION lib/pkgconfig)
install(FILES ${CMAKE_SOURCE_DIR}/rwkv.h DESTINATION include)
endif()
10 changes: 10 additions & 0 deletions rwkv.pc.in
@@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${prefix}/lib

Name: librwkv
Description: The rwkv.cpp Library
Version: 0.0.0
Cflags: -I${includedir}
Libs: -L${libdir} -lrwkv