19cc1ddd3SGeoffrey Martin-Noble# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
29cc1ddd3SGeoffrey Martin-Noble# See https://llvm.org/LICENSE.txt for license information.
39cc1ddd3SGeoffrey Martin-Noble# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
49cc1ddd3SGeoffrey Martin-Noble
59cc1ddd3SGeoffrey Martin-Noble"""An example WORKSPACE for configuring LLVM using a git submodule."""
69cc1ddd3SGeoffrey Martin-Noble
79cc1ddd3SGeoffrey Martin-Nobleworkspace(name = "submodule_example")
89cc1ddd3SGeoffrey Martin-Noble
99cc1ddd3SGeoffrey Martin-Noble# Or wherever your submodule is located.
109cc1ddd3SGeoffrey Martin-NobleSUBMODULE_PATH = "third_party/llvm-project"
119cc1ddd3SGeoffrey Martin-Noble
129cc1ddd3SGeoffrey Martin-Noblelocal_repository(
139cc1ddd3SGeoffrey Martin-Noble    name = "llvm-bazel",
149cc1ddd3SGeoffrey Martin-Noble    path = SUBMODULE_PATH + "/utils/bazel",
159cc1ddd3SGeoffrey Martin-Noble)
169cc1ddd3SGeoffrey Martin-Noble
17*d08f8960SGeoffrey Martin-Nobleload("@llvm-bazel//:configure.bzl", "llvm_configure", "llvm_disable_optional_support_deps")
18*d08f8960SGeoffrey Martin-Noble
199cc1ddd3SGeoffrey Martin-Noblellvm_configure(
209cc1ddd3SGeoffrey Martin-Noble    name = "llvm-project",
219cc1ddd3SGeoffrey Martin-Noble    src_path = SUBMODULE_PATH,
229cc1ddd3SGeoffrey Martin-Noble    src_workspace = "@submodule_example//:WORKSPACE",
239cc1ddd3SGeoffrey Martin-Noble)
249cc1ddd3SGeoffrey Martin-Noble
259cc1ddd3SGeoffrey Martin-Noble# Disables optional dependencies for Support like zlib and terminfo. You may
269cc1ddd3SGeoffrey Martin-Noble# instead want to configure them using the macros in the corresponding bzl
279cc1ddd3SGeoffrey Martin-Noble# files.
289cc1ddd3SGeoffrey Martin-Noblellvm_disable_optional_support_deps()
29