-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathSConscript
More file actions
21 lines (19 loc) · 875 Bytes
/
Copy pathSConscript
File metadata and controls
21 lines (19 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!python
import os
Import('env')
if not env.GetOption('clean'):
env.Prepend(LIBS = "oxsx") # needs to be first for ubuntu
env.Append(LIBPATH = "#/build")
includes = " ".join(["-I" + Dir(x).abspath for x in env["CPPPATH"]])
lib_paths = " ".join(["-L" + Dir(x).abspath for x in env["LIBPATH"]])
libs = " ".join(["-l" + x for x in env["LIBS"]])
if env["SYSTEM"] == "Darwin":
link_flags = " -Wl," + ",".join(env["LINKFLAGS"])
else:
link_flags = " -Wl," + ",".join("-rpath,{0}".format(x) for x in env["RPATH"])
with open(os.path.join("compile.sh"), "w") as f:
f.write(
''' # This file is auto generated by scons
g++ $1 -o $(basename "$1" .cpp) -O2 {0} {1} {2} {3}
'''.format(includes, lib_paths, libs, link_flags)
)