-
Notifications
You must be signed in to change notification settings - Fork 1
/
SConstruct
54 lines (37 loc) · 1.07 KB
/
SConstruct
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
import os
import sys
AddOption('--optimize',
dest='optimize',
action='store_true',
help='Run with optimization flags.')
if GetOption('optimize'):
print "Compiling with optimization on. (No debug flag)"
##########################
### Flags and Paths
##########################
cFlags = ("-O1 " if GetOption('optimize') else "-g ") + " -Wall"
linkFlags = ""
if os.uname()[0] == 'Darwin':
cFlags += " -stdlib=libstdc++"
linkFlags += " -stdlib=libstdc++"
##########################
### Set up environment
##########################
env = Environment()
env.Append(CCFLAGS=cFlags)
env.Append(LINKFLAGS=linkFlags)
sys.path.append(Dir('#').abspath + "/util")
from colorizer import colorizer
col = colorizer()
col.colorize(env)
##########################
### Compile!
##########################
files = ['src/main.cpp']
cppPath = ['/opt/local/include']
libPath = ['/opt/local/lib']
libsAll = ['ncurses']
hw = env.Program('#hello', files,
LIBS=libsAll,
LIBPATH=libPath,
CPPPATH=cppPath)