Skip to content

add a stastic library target - #61

Merged
yuvalif merged 1 commit into
lancedb:mainfrom
yuvalif:add-static-lib
Jul 9, 2026
Merged

yuvalif merged 1 commit into
lancedb:mainfrom
yuvalif:add-static-lib

Conversation

@yuvalif

@yuvalif yuvalif commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

also generate a .pc file, for external programs
to correctly link with it.
defauls is still a shared library.

@yuvalif
yuvalif requested a review from Copilot July 9, 2026 12:27
also generate a .pc file, for external programs
to correctly link with it.
defauls is still a shared library.

Fixes: lancedb#61

Signed-off-by: Yuval Lifshitz <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a CMake-controlled choice between building/installing LanceDB as a shared vs static library, and introduces generation/installation of a pkg-config .pc file so external consumers can link against the library (including static-link native dependencies).

Changes:

  • Introduces BUILD_SHARED_LIBS to switch between imported shared vs static lancedb targets and adjusts install behavior accordingly.
  • Adds a CMake probe (ProbeRustNativeLibs.cmake) to detect Rust’s required native static link libraries and wires those into the static target and .pc file.
  • Updates CI to build shared on Ubuntu/macOS and additionally build static on Ubuntu.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
lancedb.pc.in Adds a pkg-config template for consumers to discover include/lib flags and (for static) native link libs.
CMakeLists.txt Adds BUILD_SHARED_LIBS, static/shared imported target selection, .pc generation, and updated install logic.
cmake/ProbeRustNativeLibs.cmake New probe script to extract Rust native static link libraries for static builds and pkg-config output.
.github/workflows/ci.yml Extends CI matrix to include a static Ubuntu build and passes BUILD_SHARED_LIBS accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CMakeLists.txt Resolved
Comment thread cmake/ProbeRustNativeLibs.cmake Resolved
Comment thread cmake/ProbeRustNativeLibs.cmake Resolved
@yuvalif
yuvalif merged commit 1bb7927 into lancedb:main Jul 9, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants