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
98b86b3a8SGeoffrey Martin-NobleSKYLIB_VERSION = "1.0.3"
108b86b3a8SGeoffrey Martin-Noble
118b86b3a8SGeoffrey Martin-Noblehttp_archive(
128b86b3a8SGeoffrey Martin-Noble    name = "bazel_skylib",
138b86b3a8SGeoffrey Martin-Noble    sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44",
148b86b3a8SGeoffrey Martin-Noble    urls = [
158b86b3a8SGeoffrey Martin-Noble        "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version=SKYLIB_VERSION),
168b86b3a8SGeoffrey Martin-Noble        "https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version=SKYLIB_VERSION),
178b86b3a8SGeoffrey Martin-Noble    ],
188b86b3a8SGeoffrey Martin-Noble)
198b86b3a8SGeoffrey Martin-Noble
20*81d54124SChristian Siggnew_local_repository(
21*81d54124SChristian Sigg    name = "llvm-raw",
22*81d54124SChristian Sigg    build_file_content = "# empty",
239cc1ddd3SGeoffrey Martin-Noble    # Or wherever your submodule is located.
24*81d54124SChristian Sigg    path = "third_party/llvm-project",
259cc1ddd3SGeoffrey Martin-Noble)
269cc1ddd3SGeoffrey Martin-Noble
27*81d54124SChristian Siggload("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure", "llvm_disable_optional_support_deps")
28d08f8960SGeoffrey Martin-Noble
29*81d54124SChristian Siggllvm_configure(name = "llvm-project")
309cc1ddd3SGeoffrey Martin-Noble
319cc1ddd3SGeoffrey Martin-Noble# Disables optional dependencies for Support like zlib and terminfo. You may
329cc1ddd3SGeoffrey Martin-Noble# instead want to configure them using the macros in the corresponding bzl
339cc1ddd3SGeoffrey Martin-Noble# files.
349cc1ddd3SGeoffrey Martin-Noblellvm_disable_optional_support_deps()
35