Closed Et7f3 closed 3 years ago
What about using pkg-config
.
(rule
(targets google_include)
(action (with-stdout-to %{targets} (system "pkg-config protobuf --variable=includedir"))))
Some systems don't have pkg-config so the use of env variable should be supported but I can add a fallback if you want. So env -> pkg config -> hardcoded path.
I won't fix: Dune suggest to use the configurator (built-in dune >= 1.10 maybe lower). And the configurator do some other code to set up correctly. https://github.com/ocaml/dune/blob/master/otherlibs/configurator/src/v1.ml#L689 I can send a fix to dune but it will be only in 2.7 at least. I don't know if I am allowed to copy here. Feel free to copy/adapt if you want.
I've elected to use pkg-config following pr #26. If you know of systems which does not have access to pkg-config, we can change to use dune configurator, which has an interface for pkg-config, and allows for manual locating the include files when pkg-config is not installed.
Do you know of any systems which does not support pkg-config?
I'll close the PR for now.
Hello,
This PR has 2 goal:
INCLUDE_GOOGLE_PROTOBUF
that allow to specify where to see files + it has the benefit that it can know work with windows that obviously doesn't have /usr. In case this variable isn't provided we can assumed that we are on opam that run in a unixy env.remarks: I am not able do execute
dune build @all
is it the current way to build all even the example ? Were they broken before. In any case it isn't a issue has we can use from as dependencies correctly.