-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSconstruct
45 lines (35 loc) · 1.14 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
# -*- mode: Python; -*-
import platform
import fnmatch
import os
def RecursiveGlob(pathname, fileMatcher):
matches = []
for root, dirnames, filenames in os.walk(pathname):
for filename in fnmatch.filter(filenames, fileMatcher):
matches.append(File(os.path.join(root, filename)))
return matches
env = Environment()
if(platform.system() == "Linux"):
env.Replace( CXX = 'clang++' )
env.Append( CPPFLAGS = '-Wall -std=c++11' )
env.Append( LINKFLAGS = '-Wall' )
env.Append( CPPPATH = [] )
env.Append( LIBPATH = [] )
env.Append( LIBS = [] )
targetFile = 'run'
elif(platform.system() == "Windows"):
env.Append( CPPFLAGS = '/W3 /EHcs /D "WIN32" /D "_WIN32_WINNT#0x501" /D "_CONSOLE"')
#env.Append( LINKFLAGS = '-Wall' )
env.Append( CPPPATH = [] )
env.Append( LIBPATH = [] )
env.Append( LIBS = [] )
targetFile = 'run.exe'
else:
print platform.system() + " not supported"
# Build config
targetDir = 'build'
sources = RecursiveGlob('src', '*.cpp')
env.Program(
target = [ targetDir + '/' + targetFile ],
source = [ sources ]
)