diff --git a/build/LLVM.lua b/build/LLVM.lua index 507fcbad..225bcec5 100644 --- a/build/LLVM.lua +++ b/build/LLVM.lua @@ -100,20 +100,13 @@ function SetupLLVMLibs() defines { "__STDC_CONSTANT_MACROS", "__STDC_LIMIT_MACROS" } filter { "system:macosx" } - links { "c++", "curses" } - - filter { "system:macosx or system:linux" } - links { "pthread", "z" } + links { "c++", "curses", "pthread", "z" } filter { "action:vs*" } links { "version" } filter {} - if os.ishost("linux") and os.isfile("/usr/lib/libtinfo.so") then - links { "tinfo" } - end - if LLVMDirPerConfiguration then filter { "configurations:Debug" } libdirs { path.join(LLVMRootDirDebug, "build/lib") } diff --git a/build/scripts/LLVM.lua b/build/scripts/LLVM.lua index d40c420f..7f60395d 100644 --- a/build/scripts/LLVM.lua +++ b/build/scripts/LLVM.lua @@ -4,6 +4,14 @@ require "../Helpers" local llvm = path.getabsolute(basedir .. "/../deps/llvm") +-- Prevent premake from inserting /usr/lib64 search path on linux. GCC does not need this path specified +-- as compiler automatically knows where to look for system libs. Insertion of this path causes issues +-- when system has clang/llvm libs installed. Build would link to system libraries instead of custom +-- build required by CppSharp. +if os.istarget("linux") then + premake.tools.gcc.libraryDirectories['architecture']['x86_64'] = function(cfg) return {} end +end + -- If we are inside vagrant then clone and build LLVM outside the shared folder, -- otherwise file I/O performance will be terrible. if is_vagrant() then