-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlakefile
57 lines (47 loc) · 1.74 KB
/
lakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
-- Lake file for luaclang
local needs = { "clang", "llvm", "lua" }
LLVM_LIBS = "LLVMRuntimeDyld LLVMObject LLVMLinker LLVMipo LLVMJIT LLVMExecutionEngine LLVMDebugInfo LLVMBitWriter LLVMX86Disassembler LLVMX86AsmParser LLVMX86CodeGen LLVMX86Desc LLVMX86AsmPrinter LLVMX86Utils LLVMX86Info LLVMArchive LLVMBitReader LLVMSelectionDAG LLVMAsmPrinter LLVMMCParser LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMTarget LLVMCore LLVMMC LLVMSupport"
CLANG_LIBS = "clangFrontend clangLex clangParse clangDriver clangCodeGen clangSema clangSerialization clangAnalysis clangAST clangBasic"
if PLAT == "Darwin" then
LLVM_DIR = 'osx/llvm-3.0'
CLANG_DIR = 'osx/llvm-3.0'
elseif PLAT == "Linux" then
local arch = "32"
if utils.shell("uname -m") == "x86_64" then
arch = "64"
end
LLVM_DIR = 'linux/llvm-3.0'
CLANG_DIR = 'linux/llvm-3.0'
LLVM_LIB_DIR = LLVM_DIR .. "/lib" .. arch
CLANG_LIB_DIR = CLANG_DIR .. "/lib" .. arch
needs[#needs+1] = "pthread"
PTHREAD_DIR = '/usr/'
PTHREAD_LIBS = 'pthread'
else
error (PLAT .. " not supported")
end
cpp.shared{
'clang',
-- source files:
src = {
'src/Compiler.cpp',
'src/luaopen_clang.cpp',
'src/llvm_export.cpp',
'src/luaclang_ffi.cpp',
},
-- LLVM needs these defines / flags:
defines = {
"NDEBUG",
"_GNU_SOURCE",
"__STDC_LIMIT_MACROS",
"__STDC_CONSTANT_MACROS",
"__STDC_FORMAT_MACROS",
},
flags = "-fno-rtti -fomit-frame-pointer -fno-exceptions -O3 -export-dynamic",
--flags = "-fno-rtti -fomit-frame-pointer -fno-exceptions -fPIC -O3 -Woverloaded-virtual -Wcast-qual",
-- library dependencies:
needs = needs,
-- put results in debug / release folders
--odir = true,
}
target('install', 'clang', 'sudo cp $(DEPENDS) /usr/local/lib/lua/5.1/$(DEPENDS)')