-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConstruct
executable file
·50 lines (39 loc) · 1.61 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
import os, sys
#if you update the rt midi library, update this
RT_MIDI_FOLDER='rtmidi-1.0.10'
env = Environment()
JAVA_HOME = os.environ.get('JAVA_HOME')
cxxFiles = env.Glob('*.cxx')
cppFiles = env.Glob('*.cpp')
#debugging flag to tell the compiler to insert debug symbols
if (sys.platform == 'win32'):
JAVA_HOME_INC = JAVA_HOME + "\include"
WIN_INCLUDE = os.environ.get('INCLUDES')
if (WIN_INCLUDE == None or WIN_INCLUDE == ''):
print 'INCLUDE environment variable for SDK headers not defined'
exit()
else:
print "Using Include folder: " + WIN_INCLUDE
WIN_LIB = os.environ.get('LIB')
if (WIN_LIB == None or WIN_LIB == ''):
print 'LIB environment variable for Lib objects not defined'
exit()
else:
print "Using Library folder: " + WIN_LIB
env.AppendUnique(CXXFLAGS = Split("/EHsc"))
env.AppendUnique(LIBPATH = [WIN_LIB])
env.AppendUnique(CPPPATH = [JAVA_HOME_INC, JAVA_HOME_INC + "\win32", WIN_INCLUDE, RT_MIDI_FOLDER])
env.AppendUnique(CCFLAGS = ["-D__WINDOWS_MM__"])
env.AppendUnique(LIBS = ["WinMM"])
cppFiles += env.Glob(RT_MIDI_FOLDER+'\*.cpp')
elif (sys.platform == 'linux2'):
env.AppendUnique(CCFLAGS = ["-I."])
env.AppendUnique(CCFLAGS = ["-g"])
JAVA_HOME_INC = JAVA_HOME + "/include"
env.AppendUnique(CCFLAGS = ["-I"+RT_MIDI_FOLDER])
env.AppendUnique(CCFLAGS = ["-I"+JAVA_HOME_INC])
env.AppendUnique(CCFLAGS = ["-I" + JAVA_HOME_INC + "/linux"])
env.AppendUnique(CCFLAGS = ["-D__LINUX_ALSASEQ__"])
env.AppendUnique(LIBS = ["asound", "pthread"])
cppFiles += env.Glob(RT_MIDI_FOLDER+'/*.cpp')
env.SharedLibrary('jrtmidi', cxxFiles + cppFiles)