[llvm] 9f4f729 - [NFC] Fix build when LLVM_DEFAULT_TARGET_TRIPLE=""

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 31 11:32:15 PST 2022


Author: Chris Bieneman
Date: 2022-01-31T13:31:55-06:00
New Revision: 9f4f729207353827abe2de45a352b9fb1c3d53ba

URL: https://github.com/llvm/llvm-project/commit/9f4f729207353827abe2de45a352b9fb1c3d53ba
DIFF: https://github.com/llvm/llvm-project/commit/9f4f729207353827abe2de45a352b9fb1c3d53ba.diff

LOG: [NFC] Fix build when LLVM_DEFAULT_TARGET_TRIPLE=""

We do support building with a default target unspecified. This fixes
two small build issues that prevented LLVM's unit tests from building
and libSupport from building on Windows.

Added: 
    

Modified: 
    llvm/lib/Support/Windows/Host.inc
    llvm/unittests/Support/Host.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/Windows/Host.inc b/llvm/lib/Support/Windows/Host.inc
index 5583db909045a..fa6b00f19b9a0 100644
--- a/llvm/lib/Support/Windows/Host.inc
+++ b/llvm/lib/Support/Windows/Host.inc
@@ -10,6 +10,9 @@
 //
 //===----------------------------------------------------------------------===//
 
+// We need to include config.h here because LLVM_DEFAULT_TARGET_TRIPLE is not
+// defined in llvm-config.h if it is unset.
+#include "llvm/Config/config.h"
 #include "llvm/Support/Windows/WindowsSupport.h"
 #include <cstdio>
 #include <string>

diff  --git a/llvm/unittests/Support/Host.cpp b/llvm/unittests/Support/Host.cpp
index f5434b138abc4..888cfb2658e42 100644
--- a/llvm/unittests/Support/Host.cpp
+++ b/llvm/unittests/Support/Host.cpp
@@ -7,9 +7,9 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Support/Host.h"
-#include "llvm/Config/llvm-config.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/Triple.h"
+#include "llvm/Config/config.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/Program.h"


        


More information about the llvm-commits mailing list