|
|
|
@ -2,18 +2,26 @@
@@ -2,18 +2,26 @@
|
|
|
|
|
|
|
|
|
|
LLVMRootDir = depsdir .. "/llvm/" |
|
|
|
|
|
|
|
|
|
local LLVMDirPerConfiguration = false |
|
|
|
|
|
|
|
|
|
local LLVMRootDirDebug = "" |
|
|
|
|
local LLVMRootDirRelease = "" |
|
|
|
|
|
|
|
|
|
require "scripts/LLVM" |
|
|
|
|
|
|
|
|
|
function SearchLLVM() |
|
|
|
|
local pkg_path = basedir .. "/scripts/" .. get_llvm_package_name() |
|
|
|
|
if os.isdir(pkg_path) then |
|
|
|
|
LLVMRootDir = pkg_path |
|
|
|
|
LLVMRootDirDebug = basedir .. "/scripts/" .. get_llvm_package_name(nil, "Debug") |
|
|
|
|
LLVMRootDirRelease = basedir .. "/scripts/" .. get_llvm_package_name() |
|
|
|
|
|
|
|
|
|
if os.isdir(LLVMRootDirDebug) or os.isdir(LLVMRootDirRelease) then |
|
|
|
|
LLVMDirPerConfiguration = true |
|
|
|
|
print("Using debug LLVM build: " .. LLVMRootDirDebug) |
|
|
|
|
print("Using release LLVM build: " .. LLVMRootDirRelease) |
|
|
|
|
elseif os.isdir(LLVMRootDir) then |
|
|
|
|
print("Using LLVM build: " .. LLVMRootDir) |
|
|
|
|
else |
|
|
|
|
error("Error finding an LLVM build") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
print("Using LLVM build: " .. LLVMRootDir) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
function get_llvm_build_dir() |
|
|
|
@ -23,15 +31,37 @@ end
@@ -23,15 +31,37 @@ end
|
|
|
|
|
function SetupLLVMIncludes() |
|
|
|
|
local c = configuration() |
|
|
|
|
|
|
|
|
|
local LLVMBuildDir = get_llvm_build_dir() |
|
|
|
|
includedirs |
|
|
|
|
{ |
|
|
|
|
path.join(LLVMRootDir, "include"), |
|
|
|
|
path.join(LLVMRootDir, "tools/clang/include"), |
|
|
|
|
path.join(LLVMRootDir, "tools/clang/lib"), |
|
|
|
|
path.join(LLVMBuildDir, "include"), |
|
|
|
|
path.join(LLVMBuildDir, "tools/clang/include"), |
|
|
|
|
} |
|
|
|
|
if LLVMDirPerConfiguration then |
|
|
|
|
configuration { "Debug" } |
|
|
|
|
includedirs |
|
|
|
|
{ |
|
|
|
|
path.join(LLVMRootDirDebug, "include"), |
|
|
|
|
path.join(LLVMRootDirDebug, "tools/clang/include"), |
|
|
|
|
path.join(LLVMRootDirDebug, "tools/clang/lib"), |
|
|
|
|
path.join(LLVMRootDirDebug, "build/include"), |
|
|
|
|
path.join(LLVMRootDirDebug, "build/tools/clang/include"), |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
configuration { "Release" } |
|
|
|
|
includedirs |
|
|
|
|
{ |
|
|
|
|
path.join(LLVMRootDirRelease, "include"), |
|
|
|
|
path.join(LLVMRootDirRelease, "tools/clang/include"), |
|
|
|
|
path.join(LLVMRootDirRelease, "tools/clang/lib"), |
|
|
|
|
path.join(LLVMRootDirRelease, "build/include"), |
|
|
|
|
path.join(LLVMRootDirRelease, "build/tools/clang/include"), |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
local LLVMBuildDir = get_llvm_build_dir() |
|
|
|
|
includedirs |
|
|
|
|
{ |
|
|
|
|
path.join(LLVMRootDir, "include"), |
|
|
|
|
path.join(LLVMRootDir, "tools/clang/include"), |
|
|
|
|
path.join(LLVMRootDir, "tools/clang/lib"), |
|
|
|
|
path.join(LLVMBuildDir, "include"), |
|
|
|
|
path.join(LLVMBuildDir, "tools/clang/include"), |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
configuration(c) |
|
|
|
|
end |
|
|
|
@ -39,21 +69,31 @@ end
@@ -39,21 +69,31 @@ end
|
|
|
|
|
function SetupLLVMLibs() |
|
|
|
|
local c = configuration() |
|
|
|
|
|
|
|
|
|
local LLVMBuildDir = get_llvm_build_dir() |
|
|
|
|
libdirs { path.join(LLVMBuildDir, "lib") } |
|
|
|
|
|
|
|
|
|
configuration { "Debug", "vs*" } |
|
|
|
|
libdirs { path.join(LLVMBuildDir, "Debug/lib") } |
|
|
|
|
|
|
|
|
|
configuration { "Release", "vs*" } |
|
|
|
|
libdirs { path.join(LLVMBuildDir, "RelWithDebInfo/lib") } |
|
|
|
|
|
|
|
|
|
configuration "not vs*" |
|
|
|
|
defines { "__STDC_CONSTANT_MACROS", "__STDC_LIMIT_MACROS" } |
|
|
|
|
|
|
|
|
|
configuration "macosx" |
|
|
|
|
links { "c++", "curses", "pthread", "z" } |
|
|
|
|
|
|
|
|
|
configuration {} |
|
|
|
|
|
|
|
|
|
if LLVMDirPerConfiguration then |
|
|
|
|
configuration { "Debug" } |
|
|
|
|
libdirs { path.join(LLVMRootDirDebug, "build/lib") } |
|
|
|
|
|
|
|
|
|
configuration { "Release" } |
|
|
|
|
libdirs { path.join(LLVMRootDirRelease, "build/lib") } |
|
|
|
|
else |
|
|
|
|
local LLVMBuildDir = get_llvm_build_dir() |
|
|
|
|
libdirs { path.join(LLVMBuildDir, "lib") } |
|
|
|
|
|
|
|
|
|
configuration { "Debug", "vs*" } |
|
|
|
|
libdirs { path.join(LLVMBuildDir, "Debug/lib") } |
|
|
|
|
|
|
|
|
|
configuration { "Release", "vs*" } |
|
|
|
|
libdirs { path.join(LLVMBuildDir, "RelWithDebInfo/lib") } |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
configuration "*" |
|
|
|
|
links |
|
|
|
|
{ |
|
|
|
|