-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConstruct
72 lines (56 loc) · 2.19 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import fnmatch
import sys
import os
from subprocess import call
# User variables
VST2_SDK_HEADERS = 'E:/dev/.____Libraries/VST3 SDK'
VST2_SDK_CPP = 'E:/dev/.____Libraries/VST3 SDK/public.sdk/source/vst2.x'
OPENGL_AND_GLEW_HEADERS = 'E:/dev/.____Libraries/GL/include'
GLEW_LIBRARY = 'E:/dev/.____Libraries/GL/lib/x64'
WEBP_INC = 'E:/dev/.____Libraries/libwebp_x64/include'
WEBP_LIB = 'E:/dev/.____Libraries/libwebp_x64/lib'
# VANANAGUI = 'E:/dev/.____Libraries/VananaGUI'
env = Environment(
CPPPATH=['./src', VST2_SDK_HEADERS, OPENGL_AND_GLEW_HEADERS, WEBP_INC],
CPPDEFINES=['WIN32'],
CCFLAGS='/nologo /EHsc ',
LIBS=['user32', 'gdi32', 'shell32', 'opengl32', 'glew32s', 'libwebp'],
LIBPATH=[GLEW_LIBRARY, WEBP_LIB],
SHCXXCOMSTR = "Compiling $TARGET",
SHLINKCOMSTR = "Linking $TARGET"
)
env.Append(LINKFLAGS='/DEF:src/exports.def')
env.Append(LINKFLAGS='/SUBSYSTEM:CONSOLE')
env.Append(LINKFLAGS='build/assets.res')
# Debug and release target
release = ARGUMENTS.get('release', 0)
if int(release):
env.Append(CCFLAGS = '/O2')
env.Append(LINKFLAGS = '')
else:
env.Append(CCFLAGS = '/Od')
env.Append(LINKFLAGS = '/DEBUG:FULL')
env.Append(CPPDEFINES = 'DEBUG')
# if 'x86' == arch:
# env.Append(LINKFLAGS = '/MACHINE:X86')
# elif 'x64' == architecture:
# # nothing
# Gather list of sources
sources = []
for root, dirnames, filenames in os.walk('src'):
for filename in filenames:
if fnmatch.fnmatch(filename, '*.cpp'):
sources.append(str(os.path.join(root, filename)))
for root, dirnames, filenames in os.walk(VST2_SDK_CPP):
for filename in filenames:
if fnmatch.fnmatch(filename, '*.cpp'):
sources.append(str(os.path.join(root, filename)))
# for root, dirnames, filenames in os.walk(VANANAGUI):
# for filename in filenames:
# if fnmatch.fnmatch(filename, '*.cpp'):
# sources.append(str(os.path.join(root, filename)))
# Build DLL
call('windres src/assets.rc build/assets.res')
VariantDir('build', 'src', duplicate=0)
sources = [s.replace('src', 'build', 1) for s in sources]
env.SharedLibrary('build/I3DL2Refurb.dll', source=sources)