build_data.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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. #ifndef CARBON_COMMON_BUILD_DATA_H_
  5. #define CARBON_COMMON_BUILD_DATA_H_
  6. #include "common/build_data_linkstamp.h"
  7. #include "llvm/ADT/StringRef.h"
  8. namespace Carbon::BuildData {
  9. // Build information for a binary, from bazel. Stamped values come from:
  10. // https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkstampCompileHelper.java
  11. // NOLINTBEGIN(readability-identifier-naming): We want to use constant-style
  12. // names for the public variables, but cannot use constexpr.
  13. // The platform, per https://bazel.build/extending/platforms.
  14. extern const llvm::StringRef Platform;
  15. // Whether coverage is enabled.
  16. extern const bool BuildCoverageEnabled;
  17. // The binary target, such as `//common:build_data_test`.
  18. extern const llvm::StringRef TargetName;
  19. // The path to the build target, such as
  20. // `bazel-out/k8-fastbuild/bin/common/build_data_test`.
  21. extern const llvm::StringRef BuildTarget;
  22. // NOLINTEND(readability-identifier-naming)
  23. } // namespace Carbon::BuildData
  24. #endif // CARBON_COMMON_BUILD_DATA_H_