BUILD 1.0 KB

123456789101112131415161718192021222324252627282930
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #
  5. # Note that this is not a BUILD file that is part of the larger Carbon project, and
  6. # is not built by running `bazel build //examples/bazel/...`. This is its own
  7. # _distinct_ example Bazel project rooted at `examples/bazel`. You will need to
  8. # `cd` into this directory to interact with it.
  9. #
  10. # For more details about how to manually interact with this example, please see
  11. # the adjacent `MODULES.bazel` file.
  12. load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
  13. cc_library(
  14. name = "example_lib",
  15. srcs = [
  16. "example_lib.cpp",
  17. "example_lib.h",
  18. ],
  19. # We force static linking here so we can test compilation without performing
  20. # a full link that is more expensive with runtimes on demand.
  21. linkstatic = 1,
  22. )
  23. cc_binary(
  24. name = "example",
  25. srcs = ["example.cpp"],
  26. deps = [":example_lib"],
  27. )