Skip to content

Commit 0e99fcb

Browse files
authored
Merge pull request #780 from fg91/fg91/feat/expose-cmake-env-vars2
Feat: Pass CMAKE_ env vars to cmake config
2 parents 378edb9 + 40c8480 commit 0e99fcb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llama-cpp-sys-2/build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,13 @@ fn main() {
271271
config.define("LLAMA_BUILD_TOOLS", "OFF");
272272
config.define("LLAMA_CURL", "OFF");
273273

274+
// Pass CMAKE_ environment variables down to CMake
275+
for (key, value) in env::vars() {
276+
if key.starts_with("CMAKE_") {
277+
config.define(&key, &value);
278+
}
279+
}
280+
274281
config.define(
275282
"BUILD_SHARED_LIBS",
276283
if build_shared_libs { "ON" } else { "OFF" },

0 commit comments

Comments
 (0)