Host.inc 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //===- llvm/Support/Win32/Host.inc ------------------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file implements the Win32 Host support.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. // We need to include config.h here because LLVM_DEFAULT_TARGET_TRIPLE is not
  13. // defined in llvm-config.h if it is unset.
  14. #include "llvm/Config/config.h"
  15. #include "llvm/Support/Windows/WindowsSupport.h"
  16. #include <cstdio>
  17. #include <string>
  18. using namespace llvm;
  19. static std::string updateTripleOSVersion(std::string Triple) {
  20. return Triple;
  21. }
  22. std::string sys::getDefaultTargetTriple() {
  23. const char *Triple = LLVM_DEFAULT_TARGET_TRIPLE;
  24. // Override the default target with an environment variable named by LLVM_TARGET_TRIPLE_ENV.
  25. #if defined(LLVM_TARGET_TRIPLE_ENV)
  26. if (const char *EnvTriple = std::getenv(LLVM_TARGET_TRIPLE_ENV))
  27. Triple = EnvTriple;
  28. #endif
  29. return Triple;
  30. }