Carsten Mattner via llvm-dev
2016-Jan-11 20:37 UTC
[llvm-dev] --enable-bindings=none equivalent with CMake
I haven't been able to find the equivalent of ./configure --enable-bindings=none for use with CMake. -DLLVM_BINDINGS_LIST= (empty argument) didn't work, and the cmake script still searched for OCaml and Go. What's the correct switch?
Carsten Mattner via llvm-dev
2016-Jan-14 16:54 UTC
[llvm-dev] --enable-bindings=none equivalent with CMake
On Mon, Jan 11, 2016 at 9:37 PM, Carsten Mattner <carstenmattner at gmail.com> wrote:> I haven't been able to find the equivalent of ./configure > --enable-bindings=none for use > with CMake. -DLLVM_BINDINGS_LIST= (empty argument) didn't work, and the > cmake script still searched for OCaml and Go. > > What's the correct switch?Is there no switch?
Dan Liew via llvm-dev
2016-Jan-14 17:31 UTC
[llvm-dev] --enable-bindings=none equivalent with CMake
>> What's the correct switch? > > Is there no switch?AFAICT there is no switch to disable the bindings. If you take a look at ``cmake/config-ix.cmake`` the only conditional guarding ``find_package(Ocaml)`` is ``WIN32``. The current behaviour looks like (for both OCaml and Go) if not on Windows CMake will try to detect them and if it fails the bindings will be disabled. I'd happily review a patch that adds the behaviour you want. You could add a CMake cache variable called LLVM_ENABLED_BINDINGS that is a list (i.e. separated by ``;``) of bindings to enable. We would need to decide what the different behaviours would need to be. In some circumstances you want the configure to continue even if certain things (e.g. OCaml) aren't found and in other situations (i.e. certain bindings were explicitly requested) you want the configure to fail if those things (e.g. OCaml) aren't found. One possible way would be to have the following possible list element values * ``auto``. Preserves the existing behaviour and is the default. This will try to enable all bindings, if a particular binding cannot be built then a non-fatal message will be emitted and configuring will continue. Mixing ``auto`` with other possible list element values is an error. * ``go`` - the go bindings * ``ocaml`` - the ocaml bindings Setting the list to empty would disable building all bindings.