-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSConstruct
More file actions
57 lines (46 loc) · 1.84 KB
/
SConstruct
File metadata and controls
57 lines (46 loc) · 1.84 KB
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
import os
import os.path
import sys
AddOption('--cxx', action='store', type='string', dest='cxx', nargs=1, metavar='COMPILER',
help='Use argument as the C++ compiler.')
AddOption('--llpm', action='store', type='string', dest='llpm', nargs=1,
default='../llpm/',
help='Location of LLPM build tree')
LlpmPath = GetOption('llpm')
print "Using LLPM tree at:", LlpmPath
LibPaths = [".", "./bin/", LlpmPath + "bin/llvm/lib",
LlpmPath + "bin/", LlpmPath + "bin/flopc++/lib"]
CxxLdFlags = """
-g -pthread -fno-omit-frame-pointer -Wno-unused-parameter
""".split()
env = Environment(
CPPPATH=['.', LlpmPath + 'bin/llvm/include/', LlpmPath + 'lib/'],
CXXFLAGS="""-O0 -mfpmath=sse -msse4 -march=native
-Wall -Wextra -std=c++1y
-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS """.split()
+ CxxLdFlags,
LIBS="""tinyxml2 boost_program_options boost_filesystem boost_system
LLVM-3.7 llpm link_hacks FlopCpp OsiCbc""".split(),
LIBPATH=LibPaths,
LINKFLAGS=[]
+ CxxLdFlags
+ map(lambda x: "-Wl,-rpath=\$$ORIGIN/../%s" % x, LibPaths),
tools = ["default", "doxygen"],
toolpath = '.'
)
if GetOption('cxx') != None:
env.Replace(CXX = GetOption('cxx'))
libenv = env.Clone()
spatialc = libenv.SharedLibrary('bin/spatialc',
Glob("./frontend/*.cpp") +
Glob("./util/*.cpp") +
["grammar/Absyn.C", "grammar/Printer.C",
"grammar/Parser.C", "grammar/Lexer.C"])
Default(spatialc)
env.Prepend(LIBS=['spatialc'])
for d in Glob("./tools/*"):
d = str(d).split("/")[-1]
driver = env.Program("bin/" + d, Glob("./tools/%s/*.cpp" % d))
Default(driver)
docs = env.Doxygen("Doxyfile")