forked from smooth80/defold
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwscript
70 lines (56 loc) · 2.59 KB
/
wscript
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
#! /usr/bin/env python
import os, sys, re
import Options
def configure(conf):
pass
def build(bld):
source = 'sound_codec.cpp sound_decoder.cpp sound.cpp'.split()
source_null = 'devices/device_null.cpp sound_null.cpp'.split()
decoders = 'decoders/decoder_wav.cpp decoders/decoder_stb_vorbis.cpp stb_vorbis/stb_vorbis.c'.split()
if bld.env['PLATFORM'] not in ['arm64-nx64']:
decoders += 'decoders/decoder_tremolo.cpp'.split()
source += decoders
defines = ''
include = ''
if 'android' in bld.env.PLATFORM:
source += ['sound_android.cpp']
elif bld.env.PLATFORM in ('armv7-darwin', 'arm64-darwin', 'x86_64-ios'):
source += ['sound_ios.mm']
else:
source += ['sound_generic.cpp']
if 'android' in bld.env.PLATFORM:
#include = 'openal/include'
source += ['devices/device_opensl.cpp']
elif 'web' in bld.env.PLATFORM:
source += ['devices/device_js.cpp']
elif 'nx64' in bld.env.PLATFORM:
source += ['devices/device_nx64.cpp']
else:
source += ['devices/device_openal.cpp']
bld.add_subdirs('openal')
if 'web' in bld.env['PLATFORM']:
bld.install_files('${PREFIX}/lib/%s/js' % bld.env['PLATFORM'], 'js/library_sound.js', postpone = False)
elif re.match('arm.*?android', bld.env['PLATFORM']):
classpath = ['%s/ext/share/java/android.jar' % bld.env.DYNAMO_HOME]
classpath = os.pathsep.join(classpath)
bld.env["JAVACFLAGS"] = '-g -source 1.7 -target 1.7'
bld.new_task_gen(features='javac seq', classpath=classpath, source_root='java')
bld.new_task_gen(features='jar seq', basedir='java', destfile='sound_android.jar')
bld.install_files('${PREFIX}/share/java', 'sound_android.jar')
sound = bld.new_task_gen(features = 'cc cxx cstaticlib ddf',
includes = '. %s' % include,
defines = defines,
target = 'sound',
source = source)
sound_null = bld.new_task_gen(features = 'cc cxx cstaticlib ddf',
includes = '.',
defines = defines,
target = 'sound_null',
source = source_null)
bld.install_files('${PREFIX}/include/sound', 'sound.h')
if sys.platform == 'win32':
#NOTE: _XBOX to get static lib and avoid dllimport/dllexport stuff
sound.defines = '_XBOX'
sound_null.defines = '_XBOX'
if not Options.options.skip_build_tests:
bld.add_subdirs('test')