forked from gongminmin/KlayGE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_external.py
161 lines (137 loc) · 5.84 KB
/
build_external.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#!/usr/bin/env python
#-*- coding: ascii -*-
from __future__ import print_function
import os, sys
from blib_util import *
def build_Boost(build_info, compiler_info):
with_filesystem = True
with_system = True
if build_info.is_dev_platform:
with_program_options = True
else:
with_program_options = False
if (0 == build_info.project_type.find("vs")) or ((("gcc" == build_info.compiler_name) or ("mgw" == build_info.compiler_name)) and (build_info.compiler_version > 60)):
with_filesystem = False
with_system = False
need_install = False
additional_options = " -DWITH_FILESYSTEM:BOOL="
if with_filesystem:
additional_options += "\"ON\""
need_install = True
else:
additional_options += "\"OFF\""
additional_options += " -DWITH_PROGRAM_OPTIONS:BOOL="
if with_program_options:
additional_options += "\"ON\""
need_install = True
else:
additional_options += "\"OFF\""
additional_options += " -DWITH_SYSTEM:BOOL="
if with_system:
additional_options += "\"ON\""
need_install = True
else:
additional_options += "\"OFF\""
build_a_project("boost", "External/boost", build_info, compiler_info, build_info.is_windows and need_install, additional_options)
def build_Python(build_info, compiler_info):
additional_options = "-DPY_VERSION_MAJOR=\"3\" -DPY_VERSION_MINOR=\"5\" -DPY_VERSION_PATCH=\"1\" \
-DCMAKE_CONFIGURATION_TYPES=\"Debug;Release;RelWithDebInfo;MinSizeRel\" \
-DDOWNLOAD_SOURCES=\"OFF\" \
-DBUILD_EXTENSIONS_AS_BUILTIN=\"ON\" \
-DBUILD_FREEZE_IMPORTLIB=\"OFF\" \
-DBUILD_PYTHON_DEVELOPMENT=\"OFF\" \
-DBUILD_PYTHON_EXECUTABLE=\"OFF\" \
-DBUILD_PGEN=\"OFF\" \
-DBUILD_WININST=\"OFF\" \
-DENABLE_AUDIOOP=\"OFF\" \
-DENABLE_CODECS_CN=\"OFF\" \
-DENABLE_CODECS_HK=\"OFF\" \
-DENABLE_CODECS_ISO2022=\"OFF\" \
-DENABLE_CODECS_JP=\"OFF\" \
-DENABLE_CODECS_KR=\"OFF\" \
-DENABLE_CODECS_TW=\"OFF\" \
-DENABLE_CTYPES=\"OFF\" \
-DENABLE_CTYPES_TEST=\"OFF\" \
-DENABLE_DECIMAL=\"OFF\" \
-DENABLE_IPV6=\"OFF\" \
-DENABLE_LOCALE=\"OFF\" \
-DENABLE_MMAP=\"OFF\" \
-DENABLE_MSI=\"OFF\" \
-DENABLE_MSVCRT=\"OFF\" \
-DENABLE_MULTIBYTECODEC=\"OFF\" \
-DENABLE_MULTIPROCESSING=\"OFF\" \
-DENABLE_OSSAUDIODEV=\"OFF\" \
-DENABLE_OVERLAPPED=\"OFF\" \
-DENABLE_PYEXPAT=\"OFF\" \
-DENABLE_SCPROXY=\"OFF\" \
-DENABLE_SELECT=\"OFF\" \
-DENABLE_SOCKET=\"OFF\" \
-DENABLE_SUBPROCESS=\"OFF\" \
-DENABLE_TESTCAPI=\"OFF\" \
-DENABLE_WINAPI=\"OFF\" \
-DINSTALL_DEVELOPMENT=\"OFF\" \
-DINSTALL_MANUAL=\"OFF\" \
-DINSTALL_TEST=\"OFF\" \
-DUSE_SYSTEM_BZip2=\"OFF\" \
-DUSE_SYSTEM_Curses=\"OFF\" \
-DUSE_SYSTEM_EXPAT=\"OFF\" \
-DUSE_SYSTEM_DB=\"OFF\" \
-DUSE_SYSTEM_GDBM=\"OFF\" \
-DUSE_SYSTEM_OpenSSL=\"OFF\" \
-DUSE_SYSTEM_READLINE=\"OFF\" \
-DUSE_SYSTEM_SQLITE3=\"OFF\" \
-DUSE_SYSTEM_TCL=\"OFF\" \
-DUSE_SYSTEM_ZLIB=\"OFF\" \
-DWITH_COMPUTED_GOTOS=\"OFF\" \
-DWITH_DOC_STRINGS=\"OFF\" \
-DWITH_TSC:BOOL=\"OFF\""
build_a_project("Python", "External/Python", build_info, compiler_info, False, additional_options)
def build_libogg(build_info, compiler_info):
build_a_project("libogg", "External/libogg", build_info, compiler_info)
def build_libvorbis(build_info, compiler_info):
build_a_project("libvorbis", "External/libvorbis", build_info, compiler_info)
def build_freetype(build_info, compiler_info):
build_a_project("freetype", "External/freetype", build_info, compiler_info)
def build_7z(build_info, compiler_info):
build_a_project("7z", "External/7z", build_info, compiler_info, build_info.is_windows)
def build_UniversalDXSDK(build_info, compiler_info):
build_a_project("UniversalDXSDK", "External/UniversalDXSDK", build_info, compiler_info)
def build_OpenALSDK(build_info, compiler_info):
build_a_project("OpenALSDK", "External/OpenALSDK", build_info, compiler_info)
def build_rapidxml(build_info, compiler_info):
build_a_project("rapidxml", "External/rapidxml", build_info, compiler_info)
def build_wpftoolkit(build_info, compiler_info):
build_a_project("wpftoolkit", "External/wpftoolkit", build_info, compiler_info)
def build_android_native_app_glue(build_info, compiler_info):
build_a_project("android_native_app_glue", "External/android_native_app_glue", build_info, compiler_info)
def build_assimp(build_info, compiler_info):
build_a_project("assimp", "External/assimp", build_info, compiler_info)
def build_nanosvg(build_info, compiler_info):
build_a_project("nanosvg", "External/nanosvg", build_info, compiler_info)
def build_gtest(build_info, compiler_info):
build_a_project("googletest", "External/googletest", build_info, compiler_info)
def build_external_libs(build_info):
for compiler_info in build_info.compilers:
build_Boost(build_info, compiler_info)
build_Python(build_info, compiler_info)
build_7z(build_info, compiler_info)
build_rapidxml(build_info, compiler_info)
build_android_native_app_glue(build_info, compiler_info)
if not build_info.is_windows_store:
build_libogg(build_info, compiler_info)
build_libvorbis(build_info, compiler_info)
if build_info.is_dev_platform:
build_freetype(build_info, compiler_info)
if (compiler_info.arch != "arm") and (compiler_info.arch != "arm64"):
build_UniversalDXSDK(build_info, compiler_info)
if ("win" == build_info.target_platform) and (compiler_info.arch != "arm") and (compiler_info.arch != "arm64"):
build_OpenALSDK(build_info, compiler_info)
build_assimp(build_info, compiler_info)
build_nanosvg(build_info, compiler_info)
build_gtest(build_info, compiler_info)
if build_info.is_windows_desktop and ("x64" == compiler_info.arch) and ("vc" == build_info.compiler_name):
build_wpftoolkit(build_info, compiler_info)
if __name__ == "__main__":
cfg = cfg_from_argv(sys.argv)
bi = build_info(cfg.compiler, cfg.archs, cfg.cfg)
build_external_libs(bi)