diff options
Diffstat (limited to 'llvm/lib/Support/Unix/Host.inc')
-rw-r--r-- | llvm/lib/Support/Unix/Host.inc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Support/Unix/Host.inc b/llvm/lib/Support/Unix/Host.inc index 457217125a2..0ba6a25aa19 100644 --- a/llvm/lib/Support/Unix/Host.inc +++ b/llvm/lib/Support/Unix/Host.inc @@ -45,5 +45,11 @@ std::string sys::getDefaultTargetTriple() { TargetTripleString += getOSVersion(); } + // 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)) + TargetTripleString = EnvTriple; +#endif + return Triple::normalize(TargetTripleString); } |