Skip to content

Commit f8f11d2

Browse files
authored
Merge pull request #1018 from rokups/fix-unpackaged-llvm-includes
Use correct LLVM build dir for includes from unpackaged LLVM builds
2 parents 0823496 + d4c4050 commit f8f11d2

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

build/LLVM.lua

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ function SearchLLVM()
2525
end
2626

2727
function get_llvm_build_dir()
28-
return path.join(LLVMRootDir, "build")
28+
local packageDir = path.join(LLVMRootDir, get_llvm_package_name())
29+
local buildDir = path.join(LLVMRootDir, "build")
30+
if os.isdir(buildDir) then
31+
return buildDir
32+
else
33+
return packageDir
34+
end
2935
end
3036

3137
function SetupLLVMIncludes()
@@ -94,13 +100,20 @@ function SetupLLVMLibs()
94100
defines { "__STDC_CONSTANT_MACROS", "__STDC_LIMIT_MACROS" }
95101

96102
filter { "system:macosx" }
97-
links { "c++", "curses", "pthread", "z" }
98-
103+
links { "c++", "curses" }
104+
105+
filter { "system:macosx or system:linux" }
106+
links { "pthread", "z" }
107+
99108
filter { "action:vs*" }
100109
links { "version" }
101110

102111
filter {}
103112

113+
if os.ishost("linux") and os.isfile("/usr/lib/libtinfo.so") then
114+
links { "tinfo" }
115+
end
116+
104117
if LLVMDirPerConfiguration then
105118
filter { "configurations:Debug" }
106119
libdirs { path.join(LLVMRootDirDebug, "build/lib") }

0 commit comments

Comments
 (0)