-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwscript
More file actions
89 lines (70 loc) · 2.14 KB
/
wscript
File metadata and controls
89 lines (70 loc) · 2.14 KB
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
#! /usr/bin/env python
# encoding: utf-8
# a1batross, mittorn, 2018
from waflib import Logs, Configure
import os
import xml.etree.ElementTree as ET
top = '.'
FT2_CHECK='''extern "C" {
#include <ft2build.h>
#include FT_FREETYPE_H
}
int main() { return FT_Init_FreeType( NULL ); }
'''
def options(opt):
grp = opt.add_option_group('MainUI C++ options')
grp.add_option('--enable-stbtt', action = 'store_true', dest = 'USE_STBTT', default = True,
help = 'prefer stb_truetype.h over freetype [default: %(default)s]')
return
def configure(conf):
conf.load('fwgslib cxx11')
conf.env.append_unique('DEFINES', 'STDINT_H=<cstdint>')
if not conf.check_std('cxx11'):
conf.define('MY_COMPILER_SUCKS', 1)
if conf.env.DEST_OS in ['android', 'darwin', 'nswitch', 'psvita', 'emscripten'] or conf.env.MAGX:
conf.options.USE_STBTT = True
conf.define('MAINUI_USE_CUSTOM_FONT_RENDER', 1)
nortti = {
'msvc': ['/GR-'],
'default': ['-fno-rtti']
}
conf.env.append_unique('CXXFLAGS', conf.get_flags_by_compiler(nortti, conf.env.COMPILER_CC))
conf.define_cond('MAINUI_USE_STB', conf.options.USE_STBTT)
if conf.env.DEST_OS == 'android':
conf.define('NO_STL', 1)
conf.env.append_unique('CXXFLAGS', '-fno-exceptions')
if conf.env.DEST_OS != 'win32' and conf.env.DEST_OS != 'dos':
if not conf.options.USE_STBTT:
conf.check_pkg('freetype2', 'FT2', FT2_CHECK)
conf.define('MAINUI_USE_FREETYPE', 1)
def build(bld):
sources = []
ns = {'vs': 'http://schemas.microsoft.com/developer/msbuild/2003'}
root = ET.parse(bld.path.find_node('menu.vcxproj').abspath())
cl_compiles = []
for i in root.findall('vs:ItemGroup', ns):
cl_compiles += i.findall('vs:ClCompile', ns)
for i in cl_compiles:
srcfile = i.attrib['Include']
sources += [srcfile.replace('\\', '/')]
includes = [
'.',
'miniutl/',
'font/',
'controls/',
'menus/',
'model/',
'common',
'engine',
'public',
'pm_shared'
]
bld.shlib(
source = sources,
target = 'menu' + bld.env.POSTFIX,
includes = includes,
defines = 'sprintf_s=sprintf',
use = 'werror FT2 GDI32 USER32',
install_path = os.path.join(bld.env.GAMEDIR, bld.env.CLIENT_INSTALL_DIR),
cmake_skip = True
)