[llvm-commits] For mingw-w64, include differet path for 32bit version and 64bit version, because they can exist under the same directory.

Yonggang Luo luoyonggang at gmail.com
Mon Dec 10 06:37:44 PST 2012


lib/Frontend/InitHeaderSearch.cpp | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/lib/Frontend/InitHeaderSearch.cpp
b/lib/Frontend/InitHeaderSearch.cpp
index 4fddd11..3c713c8 100644
--- a/lib/Frontend/InitHeaderSearch.cpp
+++ b/lib/Frontend/InitHeaderSearch.cpp
@@ -310,11 +310,15 @@ void
InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
case llvm::Triple::MinGW32: {
// mingw-w64 crt include paths
llvm::sys::Path P(HSOpts.ResourceDir);
- P.appendComponent("../../../i686-w64-mingw32/include"); //
<sysroot>/i686-w64-mingw32/include
- AddPath(P.str(), System, true, false, false);
- P = llvm::sys::Path(HSOpts.ResourceDir);
- P.appendComponent("../../../x86_64-w64-mingw32/include"); //
<sysroot>/x86_64-w64-mingw32/include
- AddPath(P.str(), System, true, false, false);
+ if (triple.isArch32Bit()){
+ P.appendComponent("../../../i686-w64-mingw32/include"); //
<sysroot>/i686-w64-mingw32/include
+ AddPath(P.str(), System, true, false, false);
+ }
+ if (triple.isArch64Bit()){
+ P = llvm::sys::Path(HSOpts.ResourceDir);
+ P.appendComponent("../../../x86_64-w64-mingw32/include"); //
<sysroot>/x86_64-w64-mingw32/include
+ AddPath(P.str(), System, true, false, false);
+ }
// mingw.org crt include paths
P = llvm::sys::Path(HSOpts.ResourceDir);
P.appendComponent("../../../include"); // <sysroot>/include




More information about the llvm-commits mailing list