@@ -5,18 +5,21 @@ LLVMRootDir = builddir .. "/llvm/llvm-project"
55local LLVMDirPerConfiguration = false
66
77local LLVMRootDirDebug = " "
8+ local LLVMRootDirRelWithDebInfo = " "
89local LLVMRootDirRelease = " "
910
1011require " llvm/LLVM"
1112
1213function SearchLLVM ()
1314 LLVMRootDirDebug = builddir .. " /llvm/" .. get_llvm_package_name (nil , " Debug" )
14- LLVMRootDirRelease = builddir .. " /llvm/" .. get_llvm_package_name ()
15+ LLVMRootDirRelWithDebInfo = builddir .. " /llvm/" .. get_llvm_package_name (nil , " RelWithDebInfo" )
16+ LLVMRootDirRelease = builddir .. " /llvm/" .. get_llvm_package_name (nil , " Release" )
1517
16- if os .isdir (LLVMRootDirDebug ) or os .isdir (LLVMRootDirRelease ) then
18+ if os .isdir (LLVMRootDirDebug ) or os .isdir (LLVMRootDirRelWithDebInfo ) or os . isdir ( LLVMRootDirRelease ) then
1719 LLVMDirPerConfiguration = true
18- print (" Using debug LLVM build: " .. LLVMRootDirDebug )
19- print (" Using release LLVM build: " .. LLVMRootDirRelease )
20+ print (" Using cached LLVM 'Debug' build: " .. LLVMRootDirDebug )
21+ print (" Using cached LLVM 'RelWithDebInfo' build: " .. LLVMRootDirRelWithDebInfo )
22+ print (" Using cached LLVM 'Release' build: " .. LLVMRootDirRelease )
2023 elseif os .isdir (LLVMRootDir ) then
2124 print (" Using LLVM build: " .. LLVMRootDir )
2225 else
@@ -41,13 +44,13 @@ function SetupLLVMIncludes()
4144 filter { " configurations:DebugOpt" }
4245 includedirs
4346 {
44- path .join (LLVMRootDirRelease , " include" ),
45- path .join (LLVMRootDirRelease , " llvm/include" ),
46- path .join (LLVMRootDirRelease , " lld/include" ),
47- path .join (LLVMRootDirRelease , " clang/include" ),
48- path .join (LLVMRootDirRelease , " clang/lib" ),
49- path .join (LLVMRootDirRelease , " build/include" ),
50- path .join (LLVMRootDirRelease , " build/clang/include" ),
47+ path .join (LLVMRootDirRelWithDebInfo , " include" ),
48+ path .join (LLVMRootDirRelWithDebInfo , " llvm/include" ),
49+ path .join (LLVMRootDirRelWithDebInfo , " lld/include" ),
50+ path .join (LLVMRootDirRelWithDebInfo , " clang/include" ),
51+ path .join (LLVMRootDirRelWithDebInfo , " clang/lib" ),
52+ path .join (LLVMRootDirRelWithDebInfo , " build/include" ),
53+ path .join (LLVMRootDirRelWithDebInfo , " build/clang/include" ),
5154 }
5255
5356 filter { " configurations:Debug" }
@@ -95,12 +98,17 @@ function CopyClangIncludes()
9598
9699 if LLVMDirPerConfiguration then
97100 local clangBuiltinDebug = path .join (LLVMRootDirDebug , " lib" )
101+ local clangBuiltinRelWithDebInfo = path .join (LLVMRootDirRelWithDebInfo , " lib" )
98102 local clangBuiltinRelease = path .join (LLVMRootDirRelease , " lib" )
99103
100104 if os .isdir (path .join (clangBuiltinDebug , " clang" )) then
101105 clangBuiltinIncludeDir = clangBuiltinDebug
102106 end
103107
108+ if os .isdir (path .join (clangBuiltinRelWithDebInfo , " clang" )) then
109+ clangBuiltinIncludeDir = clangBuiltinRelWithDebInfo
110+ end
111+
104112 if os .isdir (path .join (clangBuiltinRelease , " clang" )) then
105113 clangBuiltinIncludeDir = clangBuiltinRelease
106114 end
@@ -134,7 +142,7 @@ function SetupLLVMLibs()
134142
135143 if LLVMDirPerConfiguration then
136144 filter { " configurations:DebugOpt" }
137- libdirs { path .join (LLVMRootDirRelease , " build/lib" ) }
145+ libdirs { path .join (LLVMRootDirRelWithDebInfo , " build/lib" ) }
138146
139147 filter { " configurations:Debug" }
140148 libdirs { path .join (LLVMRootDirDebug , " build/lib" ) }
@@ -150,9 +158,6 @@ function SetupLLVMLibs()
150158
151159 filter { " configurations:Debug" , " toolset:msc*" }
152160 libdirs { path .join (LLVMBuildDir , " Debug/lib" ) }
153-
154- filter { " configurations:Release" , " toolset:msc*" }
155- libdirs { path .join (LLVMBuildDir , " RelWithDebInfo/lib" ) }
156161 end
157162
158163 filter {}
0 commit comments