Skip to content

Commit ce73760

Browse files
committed
[cmake] Add a switch to enable/disable bindings.
Differential Revision: https://reviews.llvm.org/D42026 llvm-svn: 332816
1 parent 9ed890b commit ce73760

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

llvm/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ option (LLVM_INCLUDE_DOCS "Generate build targets for llvm documentation." ON)
520520
option (LLVM_ENABLE_DOXYGEN "Use doxygen to generate llvm API documentation." OFF)
521521
option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF)
522522
option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON)
523+
option (LLVM_ENABLE_BINDINGS "Build bindings." ON)
523524

524525
set(LLVM_INSTALL_DOXYGEN_HTML_DIR "share/doc/llvm/doxygen-html"
525526
CACHE STRING "Doxygen-generated HTML documentation install directory")

llvm/cmake/config-ix.cmake

+3-3
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,10 @@ else()
511511
endif()
512512

513513
set(LLVM_BINDINGS "")
514-
if(WIN32)
514+
find_program(GO_EXECUTABLE NAMES go DOC "go executable")
515+
if(WIN32 OR NOT LLVM_ENABLE_BINDINGS)
515516
message(STATUS "Go bindings disabled.")
516517
else()
517-
find_program(GO_EXECUTABLE NAMES go DOC "go executable")
518518
if(GO_EXECUTABLE STREQUAL "GO_EXECUTABLE-NOTFOUND")
519519
message(STATUS "Go bindings disabled.")
520520
else()
@@ -554,7 +554,7 @@ endif()
554554
# Keep the version requirements in sync with bindings/ocaml/README.txt.
555555
include(FindOCaml)
556556
include(AddOCaml)
557-
if(WIN32)
557+
if(WIN32 OR NOT LLVM_ENABLE_BINDINGS)
558558
message(STATUS "OCaml bindings disabled.")
559559
else()
560560
find_package(OCaml)

0 commit comments

Comments
 (0)