Skip to content

Commit 291e45e

Browse files
authored
Merge pull request #521 from babichjacob/fix-publishability
fix: make `llama-cpp-sys-2` publishable again
2 parents b6f4453 + 8aa830f commit 291e45e

File tree

2 files changed

+47
-41
lines changed

2 files changed

+47
-41
lines changed

llama-cpp-sys-2/Cargo.toml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,46 +11,46 @@ include = [
1111
"wrapper.h",
1212
"build.rs",
1313
"/src",
14-
"/llama.cpp/ggml/src/ggml.c",
15-
"/llama.cpp/ggml/include/ggml.h",
16-
"/llama.cpp/ggml/src/ggml-alloc.c",
17-
"/llama.cpp/ggml/include/ggml-alloc.h",
18-
"/llama.cpp/ggml/src/ggml-backend.c",
19-
"/llama.cpp/ggml/include/ggml-backend.h",
20-
"/llama.cpp/ggml/src/ggml-backend-impl.h",
14+
15+
"/llama.cpp/common/*.h",
16+
"/llama.cpp/common/*.hpp",
17+
"/llama.cpp/common/*.cpp",
18+
"/llama.cpp/ggml/include/*.h",
19+
"/llama.cpp/ggml/src/*.h",
20+
"/llama.cpp/ggml/src/*.c",
21+
"/llama.cpp/ggml/src/*.cpp",
22+
"/llama.cpp/src/*.h",
23+
"/llama.cpp/src/*.cpp",
24+
25+
"/llama.cpp/convert_hf_to_gguf.py", # Yes, it's required
26+
27+
"/llama.cpp/common/build-info.cpp.in",
28+
2129
"/llama.cpp/ggml/src/ggml-cuda.cu",
22-
"/llama.cpp/ggml/include/ggml-cuda.h",
23-
"/llama.cpp/ggml/src/ggml-impl.h",
2430
"/llama.cpp/ggml/src/ggml-metal.m",
2531
"/llama.cpp/ggml/src/ggml-metal.metal",
26-
"/llama.cpp/ggml/include/ggml-metal.h",
27-
"/llama.cpp/ggml/src/ggml-mpi.c",
28-
"/llama.cpp/ggml/src/ggml-mpi.h",
29-
"/llama.cpp/ggml/src/ggml-opencl.cpp",
30-
"/llama.cpp/ggml/src/ggml-opencl.h",
31-
"/llama.cpp/ggml/src/ggml-quants.c",
32-
"/llama.cpp/ggml/src/ggml-quants.h",
33-
"/llama.cpp/src/llama.cpp",
34-
"/llama.cpp/src/llama-impl.h",
35-
"/llama.cpp/src/llama-vocab.h",
36-
"/llama.cpp/src/llama-vocab.cpp",
37-
"/llama.cpp/src/llama-grammar.h",
38-
"/llama.cpp/src/llama-grammar.cpp",
39-
"/llama.cpp/src/llama-sampling.h",
40-
"/llama.cpp/src/llama-sampling.cpp",
32+
4133
"/llama.cpp/include/llama.h",
42-
"/llama.cpp/src/unicode.h",
43-
"/llama.cpp/src/unicode.cpp",
44-
"/llama.cpp/src/unicode-data.h",
45-
"/llama.cpp/src/unicode-data.h",
46-
"/llama.cpp/src/unicode-data.cpp",
47-
"/llama.cpp/ggml/src/ggml-common.h",
48-
"/llama.cpp/ggml/src/ggml-cuda",
49-
"/llama.cpp/ggml/sgemm.h",
50-
"/llama.cpp/ggml/src/ggml-cuda/*",
51-
"/llama.cpp/ggml/src/ggml-cuda/template_instances/*",
52-
"/llama.cpp/ggml/src/ggml-aarch64.h",
53-
"/llama.cpp/ggml/src/ggml-aarch64.c",
34+
35+
"/llama.cpp/ggml/src/ggml-cuda/**/*",
36+
37+
"/llama.cpp/ggml/src/vulkan-shaders/**/*",
38+
39+
"/llama.cpp/ggml/src/llamafile/sgemm.h",
40+
"/llama.cpp/ggml/src/llamafile/sgemm.cpp",
41+
42+
"/llama.cpp/pocs",
43+
44+
"/llama.cpp/CMakeLists.txt",
45+
"/llama.cpp/common/CMakeLists.txt",
46+
"/llama.cpp/ggml/CMakeLists.txt",
47+
"/llama.cpp/ggml/src/CMakeLists.txt",
48+
"/llama.cpp/ggml/src/vulkan-shaders/CMakeLists.txt",
49+
"/llama.cpp/src/CMakeLists.txt",
50+
51+
"/llama.cpp/cmake",
52+
"/llama.cpp/ggml/cmake",
53+
"/llama.cpp/common/cmake",
5454
]
5555

5656
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

llama-cpp-sys-2/build.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,17 @@ fn main() {
212212

213213
let mut config = Config::new(&llama_dst);
214214

215-
config
216-
.define(
217-
"BUILD_SHARED_LIBS",
218-
if build_shared_libs { "ON" } else { "OFF" },
219-
);
215+
// Would require extra source files to pointlessly
216+
// be included in what's uploaded to and downloaded from
217+
// crates.io, so deactivating these instead
218+
config.define("LLAMA_BUILD_TESTS", "OFF");
219+
config.define("LLAMA_BUILD_EXAMPLES", "OFF");
220+
config.define("LLAMA_BUILD_SERVER", "OFF");
221+
222+
config.define(
223+
"BUILD_SHARED_LIBS",
224+
if build_shared_libs { "ON" } else { "OFF" },
225+
);
220226

221227
if cfg!(target_os = "macos") {
222228
config.define("GGML_BLAS", "OFF");

0 commit comments

Comments
 (0)