mirror of
https://github.com/RPCSX/llvm.git
synced 2025-04-10 20:20:54 +00:00

No behavior is changed if LLVM_TARGET_TRIPLE_ENV is blank or undefined. If LLVM_TARGET_TRIPLE_ENV is "TEST_TARGET_TRIPLE" and $TEST_TARGET_TRIPLE is not blank, llvm::sys::getDefaultTargetTriple() returns $TEST_TARGET_TRIPLE. Lit resets config.target_triple and config.environment[LLVM_TARGET_TRIPLE_ENV] to change the default target. Without changing LLVM_DEFAULT_TARGET_TRIPLE nor rebuilding, lit can be run; TEST_TARGET_TRIPLE=i686-pc-win32 bin/llvm-lit -sv path/to/test/ TEST_TARGET_TRIPLE=i686-pc-win32 ninja check-clang-tools Differential Revision: https://reviews.llvm.org/D33662 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305632 91177308-0d34-0410-b5e6-96231b3b80d8
31 lines
929 B
C++
31 lines
929 B
C++
//===- llvm/Support/Win32/Host.inc ------------------------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file implements the Win32 Host support.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "WindowsSupport.h"
|
|
#include <cstdio>
|
|
#include <string>
|
|
|
|
using namespace llvm;
|
|
|
|
std::string sys::getDefaultTargetTriple() {
|
|
const char *Triple = LLVM_DEFAULT_TARGET_TRIPLE;
|
|
|
|
// Override the default target with an environment variable named by LLVM_TARGET_TRIPLE_ENV.
|
|
#if defined(LLVM_TARGET_TRIPLE_ENV)
|
|
if (const char *EnvTriple = std::getenv(LLVM_TARGET_TRIPLE_ENV))
|
|
Triple = EnvTriple;
|
|
#endif
|
|
|
|
return Triple::normalize(Triple);
|
|
}
|