Browse Source

Merge pull request #235 from vovkasm/fix_linking_with_clang_libs

Add libLLVMProfileData.a to list of libs for linking.
pull/237/head
João Matos 11 years ago
parent
commit
f95e0197e1
  1. 25
      build/Helpers.lua
  2. 46
      build/LLVM.lua
  3. 44
      src/CppParser/premake4.lua
  4. 41
      src/Parser/Parser.lua

25
build/Helpers.lua

@ -94,3 +94,28 @@ function IncludeDir(dir) @@ -94,3 +94,28 @@ function IncludeDir(dir)
end
end
end
function StaticLinksOpt(libnames)
local cc = configuration()
local path = table.concat(cc.configset.libdirs, ";")
local formats
if os.is("windows") then
formats = { "%s.lib" }
else
formats = { "lib%s.a" }
end
table.insert(formats, "%s");
local existing_libnames = {}
for _, libname in ipairs(libnames) do
for _, fmt in ipairs(formats) do
local name = string.format(fmt, libname)
if os.pathsearch(name, path) then
table.insert(existing_libnames, libname)
end
end
end
links(existing_libnames)
end

46
build/LLVM.lua

@ -32,5 +32,49 @@ function SetupLLVMLibs() @@ -32,5 +32,49 @@ function SetupLLVMLibs()
configuration "macosx"
links { "c++", "curses", "pthread", "z" }
configuration "*"
links
{
"LLVMAnalysis",
"LLVMAsmParser",
"LLVMBitReader",
"LLVMBitWriter",
"LLVMCodeGen",
"LLVMCore",
"LLVMipa",
"LLVMipo",
"LLVMInstCombine",
"LLVMInstrumentation",
"LLVMIRReader",
"LLVMLinker",
"LLVMMC",
"LLVMMCParser",
"LLVMObjCARCOpts",
"LLVMObject",
"LLVMOption",
"LLVMScalarOpts",
"LLVMSupport",
"LLVMTarget",
"LLVMTransformUtils",
"LLVMVectorize",
"LLVMX86AsmParser",
"LLVMX86AsmPrinter",
"LLVMX86Desc",
"LLVMX86Info",
"LLVMX86Utils",
"clangAnalysis",
"clangAST",
"clangBasic",
"clangCodeGen",
"clangDriver",
"clangEdit",
"clangFrontend",
"clangLex",
"clangParse",
"clangSema",
"clangSerialization",
}
StaticLinksOpt { "LLVMProfileData" }
configuration(c)
end
end

44
src/CppParser/premake4.lua

@ -31,49 +31,7 @@ project "CppSharp.CppParser" @@ -31,49 +31,7 @@ project "CppSharp.CppParser"
SetupLLVMLibs()
configuration "*"
links
{
"clangAnalysis",
"clangAST",
"clangBasic",
"clangCodeGen",
"clangDriver",
"clangEdit",
"clangFrontend",
"clangLex",
"clangParse",
"clangSema",
"clangSerialization",
"LLVMAnalysis",
"LLVMAsmParser",
"LLVMBitReader",
"LLVMBitWriter",
"LLVMCodeGen",
"LLVMCore",
"LLVMipa",
"LLVMipo",
"LLVMInstCombine",
"LLVMInstrumentation",
"LLVMIRReader",
"LLVMLinker",
"LLVMMC",
"LLVMMCParser",
"LLVMObjCARCOpts",
"LLVMObject",
"LLVMOption",
"LLVMScalarOpts",
"LLVMSupport",
"LLVMTarget",
"LLVMTransformUtils",
"LLVMVectorize",
"LLVMX86AsmParser",
"LLVMX86AsmPrinter",
"LLVMX86Desc",
"LLVMX86Info",
"LLVMX86Utils",
}
end
include ("Bindings")
include ("Bindings")

41
src/Parser/Parser.lua

@ -48,44 +48,3 @@ project "CppSharp.Parser" @@ -48,44 +48,3 @@ project "CppSharp.Parser"
configuration "*"
links
{
"LLVMAnalysis",
"LLVMAsmParser",
"LLVMBitReader",
"LLVMBitWriter",
"LLVMCodeGen",
"LLVMCore",
"LLVMipa",
"LLVMipo",
"LLVMInstCombine",
"LLVMInstrumentation",
"LLVMIRReader",
"LLVMLinker",
"LLVMMC",
"LLVMMCParser",
"LLVMObjCARCOpts",
"LLVMObject",
"LLVMOption",
"LLVMScalarOpts",
"LLVMSupport",
"LLVMTarget",
"LLVMTransformUtils",
"LLVMVectorize",
"LLVMX86AsmParser",
"LLVMX86AsmPrinter",
"LLVMX86Desc",
"LLVMX86Info",
"LLVMX86Utils",
"clangAnalysis",
"clangAST",
"clangBasic",
"clangDriver",
"clangEdit",
"clangFrontend",
"clangLex",
"clangParse",
"clangSema",
"clangSerialization",
"clangCodeGen",
}
Loading…
Cancel
Save