-
Notifications
You must be signed in to change notification settings - Fork 3
/
build_unpack.py
66 lines (40 loc) · 1.19 KB
/
build_unpack.py
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
import os
from itertools import chain
import scons_base
arch_target = "x86"
target = 'unpack'
src_path = "src"
#using in mac
frameworks = scons_base.frameworks
#path
cpp_path = scons_base.cpp_path
refuse_files = scons_base.refuse_files
refuse_files.add("src/core/main.c")
refuse_files.add("main.cpp")
#src files.
cpp_src = scons_base.get_cpp_src()
print cpp_src
include_path = scons_base.get_include_paths()
env = Environment(TARGET_ARCH=arch_target,CPPDEFINES=[])
env.Append( CPPPATH=list(chain(include_path,cpp_path)) )
platform = env['PLATFORM']
print "build in platform:",platform
def build_main_in_darwin():
link_flags = " ".join(["-framework %s"%s for s in frameworks])
cc_flags = " -std=c++0x -g -DTVP_LOG_TO_COMMANDLINE_CONSOLE -DTVP_NO_CHECK_WIDE_CHAR_SIZE"
libs = ['tjs2','onig','z',
'boost_filesystem','boost_system',
'SDL2','GLEW','soil',
'freetype','bz2','png16','iconv','lzma',
'avformat','avcodec','avutil','swscale','swresample',
'openal',
]
lib_path = ['./libs',]
env.Program(target=target, source=cpp_src,
CC='c++',
CXX='clang++',
CCFLAGS=cc_flags, LINKFLAGS=link_flags,
LIBS = libs, LIBPATH = lib_path)
def build_main():
build_main_in_darwin()
build_main()