Skip to content

Commit 1073957

Browse files
committed
Extend brewcheck logic via environment variable
1 parent 913ac0c commit 1073957

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ Undefined symbols for architecture ...:
5050

5151
* If you need to change where `pkg-config` will look for the SQLite3
5252
library, set the `PKG_CONFIG_PATH` environment variable to the new
53-
directory.
53+
directory. This can be automated by setting the `SQLITE3_OCAML_BREWCHECK`
54+
environment variable; this will instruct the build to see if a _brewed_
55+
version os sqlite is installed and route `pkg-config` appropriately.
5456

5557
Credits
5658
-------

myocamlbuild.ml

+5-1
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,11 @@ let pkg_export =
712712
let env = BaseEnvLight.load () in
713713
let bcs = BaseEnvLight.var_get "brewcheck" env in
714714
let bcs = try bool_of_string bcs with _ -> false in
715-
if not bcs then ""
715+
let proc_env =
716+
try ignore (Sys.getenv "SQLITE3_OCAML_BREWCHECK"); true
717+
with _ -> false
718+
in
719+
if not (bcs || proc_env) then ""
716720
else
717721
let cmd = "brew ls sqlite | grep pkgconfig" in
718722
match read_lines_from_cmd ~max_lines:1 cmd with

0 commit comments

Comments
 (0)