1# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2# See https://llvm.org/LICENSE.txt for license information.
3# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5"""An example WORKSPACE for configuring LLVM using a git submodule."""
6
7workspace(name = "submodule_example")
8
9# Or wherever your submodule is located.
10SUBMODULE_PATH = "third_party/llvm-project"
11
12local_repository(
13    name = "llvm-bazel",
14    path = SUBMODULE_PATH + "/utils/bazel",
15)
16
17load("@llvm-bazel//:configure.bzl", "llvm_configure", "llvm_disable_optional_support_deps")
18
19llvm_configure(
20    name = "llvm-project",
21    src_path = SUBMODULE_PATH,
22    src_workspace = "@submodule_example//:WORKSPACE",
23)
24
25# Disables optional dependencies for Support like zlib and terminfo. You may
26# instead want to configure them using the macros in the corresponding bzl
27# files.
28llvm_disable_optional_support_deps()
29